mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Can delete a movie
This commit is contained in:
parent
e06cb1b28c
commit
7a451e5924
@ -21,6 +21,19 @@ export class MoviesController {
|
||||
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
|
||||
*
|
||||
|
@ -293,6 +293,8 @@ export const Routes : Route[] = [
|
||||
// Movies controller
|
||||
{path: "/movies/get_list", cb: (h) => MoviesController.GetList(h)},
|
||||
|
||||
{path: "/movies/delete", cb: (h) => MoviesController.Delete(h)},
|
||||
|
||||
|
||||
|
||||
// Virtual directory controller
|
||||
|
Loading…
Reference in New Issue
Block a user