Skip to content

Commit

Permalink
fix: approving content
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Mar 8, 2024
1 parent 7c4f69e commit 1fe426a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/approval/src/Api/PostResourceFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function __invoke(): array
{
return [
Schema\Boolean::make('isApproved')
->writable(fn (Post $post, Context $context) => $context->getActor()->can('approve', $post)),
->writable(fn (Post $post, Context $context) => $context->getActor()->can('approve', $post))
// set by the ApproveContent listener.
->set(fn () => null),
Schema\Boolean::make('canApprove')
->get(fn (Post $post, Context $context) => $context->getActor()->can('approvePosts', $post->discussion)),
];
Expand Down

0 comments on commit 1fe426a

Please sign in to comment.