1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 13:29:22 +00:00

Can delete a movie

This commit is contained in:
Pierre HUBERT 2020-04-18 11:48:38 +02:00
parent e06cb1b28c
commit 7a451e5924
2 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,19 @@ export class MoviesController {
h.send(list.map((m) => this.MovieToAPI(m))); h.send(list.map((m) => this.MovieToAPI(m)));
} }
/**
* Delete a movie
*
* @param h Request handler
*/
public static async Delete(h: RequestHandler) {
const movieID = await h.postMovieID("movieID");
await MoviesHelper.Delete(await MoviesHelper.GetInfo(movieID));
h.success();
}
/** /**
* Turn a movie into an API entry * Turn a movie into an API entry
* *

View File

@ -293,6 +293,8 @@ export const Routes : Route[] = [
// Movies controller // Movies controller
{path: "/movies/get_list", cb: (h) => MoviesController.GetList(h)}, {path: "/movies/get_list", cb: (h) => MoviesController.GetList(h)},
{path: "/movies/delete", cb: (h) => MoviesController.Delete(h)},
// Virtual directory controller // Virtual directory controller