mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 23:12:32 +03:00
feat(views/create): return error if filterBySlateId is invalid
This commit is contained in:
parent
1d798dda54
commit
2d3130840c
@ -18,6 +18,13 @@ export default async (req, res) => {
|
|||||||
return res.status(403).send({ decorator: "SERVER_CREATE_VIEW_INVALID_DATA", error: true });
|
return res.status(403).send({ decorator: "SERVER_CREATE_VIEW_INVALID_DATA", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filterBySlateId) {
|
||||||
|
const slate = await Data.getSlateById({ id: filterBySlateId });
|
||||||
|
if (!slate) {
|
||||||
|
return res.status(403).send({ decorator: "SERVER_CREATE_VIEW_INVALID_DATA", error: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const userInfo = await RequestUtilities.checkAuthorizationInternal(req, res);
|
const userInfo = await RequestUtilities.checkAuthorizationInternal(req, res);
|
||||||
if (!userInfo) return;
|
if (!userInfo) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user