Skip to content

Commit

Permalink
fix: updated reference to context.models from beforeDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyJackson85 authored and adrians5j committed Jul 5, 2020
1 parent ded5adf commit cdbf398
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default ({ createBase, context }) =>
withName("PbCategory"),
withHooks({
async beforeDelete() {
const { PbPage } = context.models[this.modelId];
const { PbPage } = context.models;
if (await PbPage.findOne()) {
throw new Error(
"Cannot delete category because some pages are linked to it."
Expand Down

0 comments on commit cdbf398

Please sign in to comment.