Refactor getAllHostActivityForAdmin handler: update paths and token verification method
This commit is contained in:
@@ -142,19 +142,19 @@ getAllHostApplication:
|
||||
method: get
|
||||
|
||||
getAllHostActivityForAdmin:
|
||||
handler: src/modules/host/handlers/hosthub/onboarding/getAllActivityOfHost.handler
|
||||
handler: src/modules/minglaradmin/handlers/hosthub/onboarding/getAllActivityOfHost.handler
|
||||
memorySize: 384
|
||||
package:
|
||||
patterns:
|
||||
- 'src/modules/host/handlers/getActivityType.*'
|
||||
- 'src/modules/host/services/**'
|
||||
- 'src/modules/minglaradmin/handlers/hosthub/onboarding/getAllActivityOfHost.handler.*'
|
||||
- 'src/modules/minglaradmin/services/**'
|
||||
- ${file(./serverless/patterns/base.yml):pattern1}
|
||||
- ${file(./serverless/patterns/base.yml):pattern2}
|
||||
- ${file(./serverless/patterns/base.yml):pattern3}
|
||||
- ${file(./serverless/patterns/base.yml):pattern4}
|
||||
events:
|
||||
- httpApi:
|
||||
path: /host/Activity_Hub/OnBoarding/get-all-activity-of-host/{id}
|
||||
path: /minglaradmin/get-all-activity-of-host/{id}
|
||||
method: get
|
||||
|
||||
getAllOnboardingHostApplications:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { verifyHostToken } from '@/common/middlewares/jwt/authForHost';
|
||||
import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda';
|
||||
import { PrismaService } from '../../../../../common/database/prisma.service';
|
||||
import { safeHandler } from '../../../../../common/utils/handlers/safeHandler';
|
||||
@@ -6,6 +5,7 @@ import ApiError from '../../../../../common/utils/helper/ApiError';
|
||||
import { string } from 'zod';
|
||||
import { PrePopulateService } from '../../../../prepopulate/services/prepopulate.service';
|
||||
import { MinglarService } from '../../../services/minglar.service';
|
||||
import { verifyMinglarAdminHostToken } from '@/common/middlewares/jwt/authForMinglarAdmin&Host';
|
||||
|
||||
const prismaService = new PrismaService();
|
||||
const minglarService = new MinglarService(prismaService);
|
||||
@@ -27,7 +27,7 @@ export const handler = safeHandler(async (
|
||||
}
|
||||
|
||||
// Verify token and get user info
|
||||
const userInfo = await verifyHostToken(token);
|
||||
const userInfo = await verifyMinglarAdminHostToken(token);
|
||||
|
||||
const hostXid = Number(event.pathParameters?.id)
|
||||
|
||||
|
||||
@@ -203,11 +203,10 @@ export class MinglarService {
|
||||
}
|
||||
|
||||
async getAllHostActivityForMinglar(search?: string, hostXid?: number) {
|
||||
await this.prisma.activities.findMany({
|
||||
return await this.prisma.activities.findMany({
|
||||
where: {
|
||||
isActive: true,
|
||||
hostXid: hostXid,
|
||||
|
||||
},
|
||||
include: {
|
||||
ActivitiesMedia: true,
|
||||
|
||||
Reference in New Issue
Block a user