Skip to content

Commit

Permalink
fix: correct query filter
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Jul 22, 2020
1 parent 0d5c6ff commit dc2a5e7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default ({ createBase, context }) =>
withHooks({
async beforeDelete() {
const { PbPage } = context.models;
if (await PbPage.findOne()) {
if (await PbPage.findOne({ query: { category: this.id } })) {
throw new Error("Cannot delete category because some pages are linked to it.");
}
}
Expand Down

0 comments on commit dc2a5e7

Please sign in to comment.