Remove all references to movies
This commit is contained in:
parent
72e0b07f71
commit
fd4431c09c
2 changed files with 6 additions and 6 deletions
|
|
@ -79,8 +79,8 @@ export class GenresController {
|
||||||
@Delete('/id/:id')
|
@Delete('/id/:id')
|
||||||
async remove(@Param('id') id: string) {
|
async remove(@Param('id') id: string) {
|
||||||
try {
|
try {
|
||||||
const deletedMovie = await this.genresService.remove(id);
|
const deletedGenre = await this.genresService.remove(id);
|
||||||
if (!deletedMovie) {
|
if (!deletedGenre) {
|
||||||
throw new NotFoundException({
|
throw new NotFoundException({
|
||||||
status: 'Error',
|
status: 'Error',
|
||||||
message: `Can't find genre with id ${id}`,
|
message: `Can't find genre with id ${id}`,
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ export class ShowsController {
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
status: 'Ok',
|
status: 'Ok',
|
||||||
message: 'Movie was updated successfully',
|
message: 'Show was updated successfully',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -148,8 +148,8 @@ export class ShowsController {
|
||||||
@Delete('id/:id')
|
@Delete('id/:id')
|
||||||
async remove(@Param('id') id: string) {
|
async remove(@Param('id') id: string) {
|
||||||
try {
|
try {
|
||||||
const deletedMovie = await this.showsService.remove(id);
|
const deletedShow = await this.showsService.remove(id);
|
||||||
if (!deletedMovie) {
|
if (!deletedShow) {
|
||||||
throw new NotFoundException({
|
throw new NotFoundException({
|
||||||
status: 'Error',
|
status: 'Error',
|
||||||
message: `Can't find show with id ${id}`,
|
message: `Can't find show with id ${id}`,
|
||||||
|
|
@ -157,7 +157,7 @@ export class ShowsController {
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
status: 'Ok',
|
status: 'Ok',
|
||||||
message: 'Movie removed successfully',
|
message: 'Show removed successfully',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue