From a56976197f52a9cf48c3e63eac400090e27f2e22 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Mon, 27 Apr 2026 16:08:17 +0700 Subject: [PATCH] update --- src/controllers/examination_type.ts | 66 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/controllers/examination_type.ts b/src/controllers/examination_type.ts index 9a028f5..50bdc4b 100644 --- a/src/controllers/examination_type.ts +++ b/src/controllers/examination_type.ts @@ -19,15 +19,15 @@ const log: Logger = new Logger({ export class ExaminationTypeController { static async list(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.parameters['filter'] = { description: 'Filter: plain text or JSON object (name, status, etc.)', in: 'query', type: 'string' } - #swagger.parameters['limit'] = { in: 'query', required: true, type: 'number' } - #swagger.parameters['page'] = { in: 'query', required: true, type: 'number' } - #swagger.parameters['with_deleted'] = { in: 'query', required: true, type: 'boolean' } - #swagger.parameters['order_field'] = { in: 'query', required: true, type: 'string' } - #swagger.parameters['order_direction'] = { in: 'query', required: true, schema: { '@enum': ['ASC', 'DESC'] } } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.parameters['filter'] = { description: 'Filter: plain text or JSON object (name, status, etc.)', in: 'query', type: 'string' } + #swagger.parameters['limit'] = { in: 'query', required: true, type: 'number' } + #swagger.parameters['page'] = { in: 'query', required: true, type: 'number' } + #swagger.parameters['with_deleted'] = { in: 'query', required: true, type: 'boolean' } + #swagger.parameters['order_field'] = { in: 'query', required: true, type: 'string' } + #swagger.parameters['order_direction'] = { in: 'query', required: true, schema: { '@enum': ['ASC', 'DESC'] } } + */ try { const schema = Joi.object().keys({ filter: Joi.string().allow("").optional().label("Filter"), @@ -51,8 +51,8 @@ export class ExaminationTypeController { const res_list = query .leftJoinAndSelect("ExaminationType.services", "services") .orderBy("ExaminationType." + param.order_field, param.order_direction) - .offset(offset) - .limit(limit); + .take(limit) + .skip(offset); if (param.with_deleted) { res_count.withDeleted(); @@ -74,10 +74,10 @@ export class ExaminationTypeController { static async create(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/examinationType" } } } } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/examinationType" } } } } + */ const queryRunner = OrmHelper.DB.createQueryRunner(); await queryRunner.startTransaction(); try { @@ -124,10 +124,10 @@ export class ExaminationTypeController { static async detail(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.parameters['id'] = { in: 'path', type: 'string' } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.parameters['id'] = { in: 'path', type: 'string' } + */ try { const schema = Joi.object().keys({ id: Joi.string().uuid().required().label("Examination Type Id"), @@ -150,11 +150,11 @@ export class ExaminationTypeController { static async update(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.parameters['id'] = { in: 'path', type: 'string' } - #swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/examinationType" } } } } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.parameters['id'] = { in: 'path', type: 'string' } + #swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/examinationType" } } } } + */ const queryRunner = OrmHelper.DB.createQueryRunner(); await queryRunner.startTransaction(); @@ -208,11 +208,11 @@ export class ExaminationTypeController { static async delete(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.parameters['id'] = { in: 'path', required: true, type: 'string' } - #swagger.parameters['hard'] = { in: 'path', description: 'Is Hard Delete', required: false, type: 'boolean' } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.parameters['id'] = { in: 'path', required: true, type: 'string' } + #swagger.parameters['hard'] = { in: 'path', description: 'Is Hard Delete', required: false, type: 'boolean' } + */ try { const schema = Joi.object().keys({ id: Joi.string().uuid().required().label("ID"), @@ -250,10 +250,10 @@ export class ExaminationTypeController { static async restore(req: Request, res: Response, next: NextFunction): Promise { /* - #swagger.tags = ['Examination Type'] - #swagger.security = [{ "bearerAuth": [] }] - #swagger.parameters['id'] = { in: 'path', required: true, type: 'string' } - */ + #swagger.tags = ['Examination Type'] + #swagger.security = [{ "bearerAuth": [] }] + #swagger.parameters['id'] = { in: 'path', required: true, type: 'string' } + */ try { const schema = Joi.object().keys({ id: Joi.string().uuid().required().label("ID"),