Snippets Groups Projects
Commit 36167e84 authored by Lorex's avatar Lorex
Browse files

fix category check at create ig

parent 81c7b44a
Branches
No related merge requests found
......@@ -101,6 +101,15 @@ module.exports = {
tags: inputs.tags,
};
// check if category exists
const category = await GuidesCategory.findOne({
id: inputs.category
});
if (!category) {
return exits.err(202);
}
// create ig
const ig = await Guides.create(igData).fetch();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment