|
@@ -5,7 +5,7 @@ export default router;
|
|
|
|
|
|
// db
|
|
|
import { selPool, updPool } from "#db";
|
|
|
-import { DbShema } from "#db-shema";
|
|
|
+import { DbSchema } from "#db-schema";
|
|
|
import { sql } from "slonik";
|
|
|
|
|
|
// api
|
|
@@ -105,10 +105,10 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
const event = await selPool.maybeOne(
|
|
|
sql.type(
|
|
|
z.object({
|
|
|
- eventId: DbShema.ev.events.eventId,
|
|
|
- localName: DbShema.ev.events.localName,
|
|
|
- timezone: DbShema.ev.events.timezone,
|
|
|
- dates: z.array(DbShema.ev.eventDates.date),
|
|
|
+ eventId: DbSchema.ev.events.eventId,
|
|
|
+ localName: DbSchema.ev.events.localName,
|
|
|
+ timezone: DbSchema.ev.events.timezone,
|
|
|
+ dates: z.array(DbSchema.ev.eventDates.date),
|
|
|
}),
|
|
|
)`
|
|
|
select
|
|
@@ -131,7 +131,7 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
if (!event) throw ApiError.BadRequest("EventNotFound", "Ивент не найден");
|
|
|
|
|
|
// points
|
|
|
- const DbPointsType = DbShema.ev.programPoints;
|
|
|
+ const DbPointsType = DbSchema.ev.programPoints;
|
|
|
const programPoints = await selPool.any(
|
|
|
sql.type(
|
|
|
z.object({
|
|
@@ -161,9 +161,9 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
const rooms = await selPool.any(
|
|
|
sql.type(
|
|
|
z.object({
|
|
|
- roomId: DbShema.ev.rooms.roomId,
|
|
|
- name: DbShema.ev.rooms.name,
|
|
|
- locationId: DbShema.ev.rooms.locationId,
|
|
|
+ roomId: DbSchema.ev.rooms.roomId,
|
|
|
+ name: DbSchema.ev.rooms.name,
|
|
|
+ locationId: DbSchema.ev.rooms.locationId,
|
|
|
}),
|
|
|
)`
|
|
|
select
|
|
@@ -184,8 +184,8 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
const taskBlocks = await selPool.any(
|
|
|
sql.type(
|
|
|
z.object({
|
|
|
- taskBlockId: DbShema.ev.taskBlocks.taskBlockId,
|
|
|
- name: DbShema.ev.taskBlocks.name,
|
|
|
+ taskBlockId: DbSchema.ev.taskBlocks.taskBlockId,
|
|
|
+ name: DbSchema.ev.taskBlocks.name,
|
|
|
}),
|
|
|
)`
|
|
|
select
|
|
@@ -201,9 +201,9 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
const managers = await selPool.any(
|
|
|
sql.type(
|
|
|
z.object({
|
|
|
- userId: DbShema.ev.eventManagers.userId,
|
|
|
- name: DbShema.usr.users.name,
|
|
|
- email: DbShema.usr.users.email,
|
|
|
+ userId: DbSchema.ev.eventManagers.userId,
|
|
|
+ name: DbSchema.usr.users.name,
|
|
|
+ email: DbSchema.usr.users.email,
|
|
|
}),
|
|
|
)`
|
|
|
select
|
|
@@ -223,8 +223,8 @@ router.get("/event/:eventId", async (req, res, next) => {
|
|
|
const roles = await selPool.any(
|
|
|
sql.type(
|
|
|
z.object({
|
|
|
- roleId: DbShema.ev.roles.roleId,
|
|
|
- name: DbShema.ev.roles.name,
|
|
|
+ roleId: DbSchema.ev.roles.roleId,
|
|
|
+ name: DbSchema.ev.roles.name,
|
|
|
}),
|
|
|
)`
|
|
|
select
|