diff --git a/src/app.controller.ts b/src/app.controller.ts index d11d1c5..5c42f1d 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -229,18 +229,23 @@ export class AppController { @Get("/visitor") @ApiBearerAuth() async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) { - let date = new Date().getDate(); + let date = new Date().toDateString(); const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no }, order: { created_date: "DESC" } }); + // console.log('node_other_visitor', node_other_visitor) if (node_other_visitor) { const node_visitor = await this.nodeVisitorRepository.findOne({ where: { id: node_other_visitor.node_visitor_id } }) - if (new Date(node_visitor.start_date) <= new Date(date) && new Date(node_visitor.end_date) >= new Date(date)) { + // console.log('node_visitor', node_visitor) + // console.log('new Date(node_visitor.start_date)', new Date(node_visitor.start_date)) + // console.log('new Date(node_visitor.end_date)', new Date(node_visitor.end_date)) + // console.log('new Date(date)', new Date(date)) + if (node_visitor && new Date(node_visitor.start_date) <= new Date(date) && new Date(node_visitor.end_date) >= new Date(date)) { node_other_visitor.info = node_visitor; } else { return null;