order
This commit is contained in:
@@ -392,13 +392,12 @@ export class OrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async calculateOrder(inputOrder?: Order, orderId?: string) {
|
async calculateOrder(inputOrder?: Order, orderId?: string) {
|
||||||
let order: undefined | Order = undefined
|
let order: undefined | Order = inputOrder
|
||||||
if (orderId) {
|
|
||||||
|
if (!order && orderId) {
|
||||||
order = await this.findOneOrFail(orderId)
|
order = await this.findOneOrFail(orderId)
|
||||||
}
|
}
|
||||||
if (order) {
|
|
||||||
order = inputOrder
|
|
||||||
}
|
|
||||||
if (!order) {
|
if (!order) {
|
||||||
throw new BadRequestException("Order not found")
|
throw new BadRequestException("Order not found")
|
||||||
}
|
}
|
||||||
@@ -446,7 +445,7 @@ export class OrderService {
|
|||||||
|
|
||||||
orderItem.confirmedAt = new Date()
|
orderItem.confirmedAt = new Date()
|
||||||
|
|
||||||
await this.em.persistAndFlush(OrderItem)
|
await this.em.persistAndFlush(orderItem)
|
||||||
|
|
||||||
return orderItem
|
return orderItem
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { AuthGuard } from '../../auth/guards/auth.guard';
|
|||||||
export class UploaderController {
|
export class UploaderController {
|
||||||
constructor(private readonly uploaderService: UploaderService) {}
|
constructor(private readonly uploaderService: UploaderService) {}
|
||||||
|
|
||||||
@UseGuards(AuthGuard)
|
// @UseGuards(AuthGuard)
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@ApiOperation({ summary: 'Upload a file (admin)' })
|
@ApiOperation({ summary: 'Upload a file (admin)' })
|
||||||
@ApiConsumes('multipart/form-data')
|
@ApiConsumes('multipart/form-data')
|
||||||
@@ -22,7 +22,7 @@ export class UploaderController {
|
|||||||
return this.uploaderService.uploadFile(file);
|
return this.uploaderService.uploadFile(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UseGuards(AuthGuard)
|
// @UseGuards(AuthGuard)
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@ApiOperation({ summary: 'Uploads multiple files' })
|
@ApiOperation({ summary: 'Uploads multiple files' })
|
||||||
@ApiConsumes('multipart/form-data')
|
@ApiConsumes('multipart/form-data')
|
||||||
|
|||||||
Reference in New Issue
Block a user