mirror of
https://github.com/flarum/framework.git
synced 2025-02-26 10:54:25 +08:00
fix: approving content
This commit is contained in:
parent
7c4f69e56f
commit
1fe426aba9
@ -19,7 +19,9 @@ class PostResourceFields
|
||||
{
|
||||
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)),
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user