mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-11 22:07:08 +03:00
feat(views/create): return error if filterBySlateId is invalid
This commit is contained in:
parent
a7daf39dd7
commit
de5cdc1ade
@ -18,6 +18,13 @@ export default async (req, res) => {
|
||||
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);
|
||||
if (!userInfo) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user