From 85626f9c5dbc8e687dc193814a0c2d562e83ef2e Mon Sep 17 00:00:00 2001 From: Priyabrat Date: Sat, 27 Jan 2024 19:01:41 +0530 Subject: [PATCH] third party url added --- src/controllers/event/add.ts | 8 ++++++++ src/controllers/event/update.ts | 8 ++++++++ src/middlewares/auth.ts | 2 ++ 3 files changed, 18 insertions(+) diff --git a/src/controllers/event/add.ts b/src/controllers/event/add.ts index 1f04107..ed71d8f 100644 --- a/src/controllers/event/add.ts +++ b/src/controllers/event/add.ts @@ -10,6 +10,7 @@ const createEvent: Interfaces.Controller.Async = async (req, res, next) => { posterImage, attendanceIncentive, registrationIncentive, + thirdPartyURL, lat, lng, maxTeamSize, @@ -83,6 +84,12 @@ const createEvent: Interfaces.Controller.Async = async (req, res, next) => { if (regStart && regEnd && regStart > regEnd) return next(Errors.Module.invalidInput); + if ( + thirdPartyURL && + (typeof thirdPartyURL !== "string" || !thirdPartyURL.length) + ) + return next(Errors.Module.invalidInput); + if ( !(await prisma.module.findFirst({ where: { id: moduleId }, @@ -132,6 +139,7 @@ const createEvent: Interfaces.Controller.Async = async (req, res, next) => { posterImage, attendanceIncentive, registrationIncentive, + thirdPartyURL, lat, lng, maxTeamSize, diff --git a/src/controllers/event/update.ts b/src/controllers/event/update.ts index b5285d5..fcbb048 100644 --- a/src/controllers/event/update.ts +++ b/src/controllers/event/update.ts @@ -10,6 +10,7 @@ const updateEvent: Interfaces.Controller.Async = async (req, res, next) => { posterImage, attendanceIncentive, registrationIncentive, + thirdPartyURL, lat, lng, maxTeamSize, @@ -63,6 +64,12 @@ const updateEvent: Interfaces.Controller.Async = async (req, res, next) => { if (regStart && regEnd && regStart > regEnd) return next(Errors.Module.invalidInput); + if ( + thirdPartyURL && + (typeof thirdPartyURL !== "string" || !thirdPartyURL.length) + ) + return next(Errors.Module.invalidInput); + const { organizers = [], managers = [], @@ -164,6 +171,7 @@ const updateEvent: Interfaces.Controller.Async = async (req, res, next) => { posterImage, attendanceIncentive, registrationIncentive, + thirdPartyURL, lat, lng, maxTeamSize, diff --git a/src/middlewares/auth.ts b/src/middlewares/auth.ts index b292d46..5938e37 100644 --- a/src/middlewares/auth.ts +++ b/src/middlewares/auth.ts @@ -42,6 +42,8 @@ const validateUser: Interfaces.Middleware.Async = async (req, _res, next) => { select: { team: { select: { + id: true, + registrationStatus: true, members: { select: { id: true,