Merge pull request 'fix: throw error when display id is undefined' (#127) from development into production
Reviewed-on: #127production 1.4.4-production.2
commit
8e0c8462b9
|
@ -1,4 +1,10 @@
|
|||
import { Controller, Get, Param, Query } from '@nestjs/common';
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
Query,
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
import { FilterItemQueueDto } from './dto/filter-item-queue.dto';
|
||||
import { Pagination } from 'src/core/response';
|
||||
import { PaginationResponse } from 'src/core/response/domain/ok-response.interface';
|
||||
|
@ -7,6 +13,7 @@ import { ItemQueueReadOrchestrator } from '../domain/usecases/item-queue-read.or
|
|||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
||||
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
|
||||
import { Public } from 'src/core/guards';
|
||||
import { validate as isValidUUID } from 'uuid';
|
||||
|
||||
@ApiTags(`${MODULE_NAME.ITEM_QUEUE.split('-').join(' ')} - read`)
|
||||
@Controller(`v1/${MODULE_NAME.ITEM_QUEUE}`)
|
||||
|
@ -44,6 +51,7 @@ export class ItemQueueReadController {
|
|||
@Get('display/:id')
|
||||
@Public(true)
|
||||
async detailPublic(@Param('id') id: string): Promise<ItemQueueEntity> {
|
||||
if (!isValidUUID(id)) throw new UnauthorizedException('id is required');
|
||||
return await this.orchestrator.detail(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,10 @@ export class QueueAdminOrchestrator {
|
|||
// },
|
||||
// ]);
|
||||
|
||||
if (queueTicket.last_notification < currentTime - call_preparation) {
|
||||
if (
|
||||
queueTicket.item.ticket.phone != null &&
|
||||
queueTicket.last_notification < currentTime - call_preparation
|
||||
) {
|
||||
await notification.queueProcess(payload);
|
||||
this.service.updateLastNotification(queueId, currentTime);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue