Fixed heart icon in other user's stashes. Syncing stashes to session on creation and removal.
This commit is contained in:
@@ -10,20 +10,27 @@ import {
|
||||
updateStash,
|
||||
} from '../stashes.js';
|
||||
|
||||
import { updateSessionUser } from './auth.js';
|
||||
|
||||
export async function createStashApi(req, res) {
|
||||
const stash = await createStash(req.body, req.session.user);
|
||||
|
||||
await updateSessionUser(req);
|
||||
|
||||
res.send(stash);
|
||||
}
|
||||
|
||||
export async function updateStashApi(req, res) {
|
||||
const stash = await updateStash(Number(req.params.stashId), req.body, req.session.user);
|
||||
|
||||
await updateSessionUser(req);
|
||||
|
||||
res.send(stash);
|
||||
}
|
||||
|
||||
export async function removeStashApi(req, res) {
|
||||
await removeStash(Number(req.params.stashId), req.session.user);
|
||||
await updateSessionUser(req);
|
||||
|
||||
res.status(204).send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user