Shows/controller: return show ID on creation
This commit is contained in:
parent
adf315a187
commit
b4eae5b0b3
1 changed files with 2 additions and 1 deletions
|
|
@ -21,10 +21,11 @@ export class ShowsController {
|
||||||
@Post()
|
@Post()
|
||||||
async create(@Body() dto: ShowDto) {
|
async create(@Body() dto: ShowDto) {
|
||||||
try {
|
try {
|
||||||
await this.showsService.create(dto);
|
const newShow = await this.showsService.create(dto);
|
||||||
return {
|
return {
|
||||||
status: 'Ok',
|
status: 'Ok',
|
||||||
message: 'Show was created successfully',
|
message: 'Show was created successfully',
|
||||||
|
newId: newShow._id
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new BadRequestException({
|
throw new BadRequestException({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue