Skip to content

Commit

Permalink
Update for Flarum beta 16 and run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkwinkelmann committed Apr 8, 2021
1 parent f008d8a commit 0648d70
Show file tree
Hide file tree
Showing 26 changed files with 126 additions and 98 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^0.1.0-beta.15"
"flarum/core": "^0.1.0-beta.16"
},
"replace": {
"reflar/polls": "^1.3.4"
Expand Down
15 changes: 7 additions & 8 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Flarum\Discussion\Discussion;
use Flarum\Discussion\Event\Saving;
use Flarum\Extend;
use Flarum\User\User;
use FoF\Polls\Api\Controllers;
use FoF\Polls\Api\Serializers\PollSerializer;

Expand Down Expand Up @@ -47,13 +46,13 @@
->hasOne('poll', PollSerializer::class),

(new Extend\ApiSerializer(UserSerializer::class))
->mutate(function (UserSerializer $serializer, User $user, array $attributes): array {
$attributes['canEditPolls'] = $serializer->getActor()->can('discussion.polls');
$attributes['canStartPolls'] = $serializer->getActor()->can('startPolls');
$attributes['canSelfEditPolls'] = $serializer->getActor()->can('selfEditPolls');
$attributes['canVotePolls'] = $serializer->getActor()->can('votePolls');

return $attributes;
->attributes(function (UserSerializer $serializer): array {
return [
'canEditPolls' => $serializer->getActor()->can('discussion.polls'),
'canStartPolls' => $serializer->getActor()->can('startPolls'),
'canSelfEditPolls' => $serializer->getActor()->can('selfEditPolls'),
'canVotePolls' => $serializer->getActor()->can('votePolls'),
];
}),

(new Extend\ApiController(Controller\ListDiscussionsController::class))
Expand Down
2 changes: 1 addition & 1 deletion js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 0648d70

Please sign in to comment.