traxxx/src/web/stashes.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-03-15 02:30:47 +00:00
'use strict';
const {
stashActor,
stashScene,
stashMovie,
unstashActor,
unstashScene,
unstashMovie,
} = require('../stashes');
2021-03-15 02:30:47 +00:00
async function stashActorApi(req, res) {
await stashActor(req.body.actorId, req.params.stashId, req.session.user);
res.status(201).send();
}
async function stashSceneApi(req, res) {
await stashScene(req.body.sceneId, req.params.stashId, req.session.user);
res.status(201).send();
}
async function stashMovieApi(req, res) {
await stashMovie(req.body.movieId, req.params.stashId, req.session.user);
res.status(201).send();
}
2021-03-15 02:30:47 +00:00
async function unstashActorApi(req, res) {
await unstashActor(req.params.actorId, req.params.stashId, req.session.user);
res.status(204).send();
}
async function unstashSceneApi(req, res) {
await unstashScene(req.params.sceneId, req.params.stashId, req.session.user);
res.status(204).send();
}
async function unstashMovieApi(req, res) {
await unstashMovie(req.params.movieId, req.params.stashId, req.session.user);
res.status(204).send();
}
2021-03-15 02:30:47 +00:00
module.exports = {
stashActor: stashActorApi,
stashScene: stashSceneApi,
stashMovie: stashMovieApi,
2021-03-15 02:30:47 +00:00
unstashActor: unstashActorApi,
unstashScene: unstashSceneApi,
unstashMovie: unstashMovieApi,
2021-03-15 02:30:47 +00:00
};