Added delete stash icons and dialog.

This commit is contained in:
DebaucheryLibrarian
2021-03-20 23:03:13 +01:00
parent 07643870cd
commit eee47111a6
14 changed files with 204 additions and 33 deletions

View File

@@ -45,6 +45,7 @@ const {
const {
createStash,
removeStash,
stashActor,
stashScene,
stashMovie,
@@ -87,6 +88,7 @@ async function initServer() {
router.post('/api/stashes', createStash);
router.patch('/api/stashes/:stashId', updateStash);
router.delete('/api/stashes/:stashId', removeStash);
router.post('/api/stashes/:stashId/actors', stashActor);
router.post('/api/stashes/:stashId/scenes', stashScene);

View File

@@ -2,6 +2,7 @@
const {
createStash,
removeStash,
stashActor,
stashScene,
stashMovie,
@@ -23,6 +24,12 @@ async function updateStashApi(req, res) {
res.send(stash);
}
async function removeStashApi(req, res) {
await removeStash(req.params.stashId, req.session.user);
res.status(204).send();
}
async function stashActorApi(req, res) {
await stashActor(req.body.actorId, req.params.stashId, req.session.user);
@@ -61,6 +68,7 @@ async function unstashMovieApi(req, res) {
module.exports = {
createStash: createStashApi,
removeStash: removeStashApi,
stashActor: stashActorApi,
stashScene: stashSceneApi,
stashMovie: stashMovieApi,