Separated user page stash component.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user