Separated user page stash component.

This commit is contained in:
DebaucheryLibrarian
2021-03-20 02:49:17 +01:00
parent 5577e4fee5
commit e88cf4e3f4
7 changed files with 218 additions and 145 deletions

View File

@@ -44,6 +44,7 @@ const {
} = require('./tags');
const {
createStash,
stashActor,
stashScene,
stashMovie,
@@ -84,6 +85,7 @@ async function initServer() {
router.post('/api/users', signup);
router.post('/api/stashes', createStash);
router.patch('/api/stashes/:stashId', updateStash);
router.post('/api/stashes/:stashId/actors', stashActor);

View File

@@ -1,6 +1,7 @@
'use strict';
const {
createStash,
stashActor,
stashScene,
stashMovie,
@@ -10,6 +11,12 @@ const {
updateStash,
} = require('../stashes');
async function createStashApi(req, res) {
const stash = await createStash(req.body, req.session.user);
res.send(stash);
}
async function updateStashApi(req, res) {
const stash = await updateStash(req.params.stashId, req.body, req.session.user);
@@ -53,6 +60,7 @@ async function unstashMovieApi(req, res) {
}
module.exports = {
createStash: createStashApi,
stashActor: stashActorApi,
stashScene: stashSceneApi,
stashMovie: stashMovieApi,