Merge branch 'sprint1' of http://git.wdipl.com/Mayank.Mishra/MinglarBackendNestJS into swagger
This commit is contained in:
@@ -324,7 +324,7 @@ RejectPQQByAM:
|
||||
- ${file(./serverless/patterns/base.yml):pattern4}
|
||||
events:
|
||||
- httpApi:
|
||||
path: /minglaradmin/hosthub/hosts/reject-pq-by-am/{activityId}
|
||||
path: /minglaradmin/hosthub/hosts/reject-pq-by-am
|
||||
method: patch
|
||||
|
||||
acceptPQByAM:
|
||||
@@ -340,7 +340,7 @@ acceptPQByAM:
|
||||
- ${file(./serverless/patterns/base.yml):pattern4}
|
||||
events:
|
||||
- httpApi:
|
||||
path: /minglaradmin/hosthub/hosts/accept-pq-by-am/{activityId}
|
||||
path: /minglaradmin/hosthub/hosts/accept-pq-by-am
|
||||
method: patch
|
||||
|
||||
rejectHostApplication:
|
||||
|
||||
@@ -8,6 +8,10 @@ import ApiError from '../../../../../common/utils/helper/ApiError';
|
||||
const prismaService = new PrismaService();
|
||||
const minglarService = new MinglarService(prismaService);
|
||||
|
||||
interface Body {
|
||||
activityId: number;
|
||||
}
|
||||
|
||||
export const handler = safeHandler(async (
|
||||
event: APIGatewayProxyEvent,
|
||||
context?: Context
|
||||
@@ -17,7 +21,16 @@ export const handler = safeHandler(async (
|
||||
|
||||
const userInfo = await verifyMinglarAdminToken(token);
|
||||
|
||||
const activityId = event.pathParameters?.activityId;
|
||||
// Parse request body
|
||||
let body: Body;
|
||||
|
||||
try {
|
||||
body = event.body ? JSON.parse(event.body) : {};
|
||||
} catch (error) {
|
||||
throw new ApiError(400, 'Invalid JSON in request body');
|
||||
}
|
||||
|
||||
const { activityId } = body;
|
||||
|
||||
if (!activityId) {
|
||||
throw new ApiError(400, 'activityId is required');
|
||||
|
||||
@@ -8,6 +8,10 @@ import { MinglarService } from '../../../services/minglar.service';
|
||||
const prismaService = new PrismaService();
|
||||
const minglarService = new MinglarService(prismaService);
|
||||
|
||||
interface Body {
|
||||
activityId: number;
|
||||
}
|
||||
|
||||
export const handler = safeHandler(async (
|
||||
event: APIGatewayProxyEvent,
|
||||
context?: Context
|
||||
@@ -17,7 +21,16 @@ export const handler = safeHandler(async (
|
||||
|
||||
const userInfo = await verifyMinglarAdminToken(token);
|
||||
|
||||
const activityId = event.pathParameters?.activityId;
|
||||
// Parse request body
|
||||
let body: Body;
|
||||
|
||||
try {
|
||||
body = event.body ? JSON.parse(event.body) : {};
|
||||
} catch (error) {
|
||||
throw new ApiError(400, 'Invalid JSON in request body');
|
||||
}
|
||||
|
||||
const { activityId } = body;
|
||||
|
||||
if (!activityId) {
|
||||
throw new ApiError(400, 'activityId is required');
|
||||
|
||||
@@ -260,6 +260,7 @@ export class MinglarService {
|
||||
async getAllHostActivityForMinglar(search?: string, hostXid?: number, paginationOptions?: { page: number; limit: number; skip: number }) {
|
||||
const whereClause: any = {
|
||||
isActive: true,
|
||||
activityInternalStatus: { notIn: [ACTIVITY_INTERNAL_STATUS.DRAFT_PQ] },
|
||||
...(hostXid ? { hostXid } : {}),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user