mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 16:58:32 +08:00
Use Settings extender serializeToForum properly now that it supports defaults.
This commit is contained in:
parent
8266966fec
commit
f2b2a26caf
|
@ -41,10 +41,8 @@ return [
|
|||
return $actor->id === $user->id && $serializer->getActor()->can('editOwnNickname', $user);
|
||||
}),
|
||||
|
||||
(new Extend\ApiSerializer(ForumSerializer::class))
|
||||
->attribute('displayNameDriver', function ($serializer, $user) {
|
||||
return app(SettingsRepositoryInterface::class)->get('display_name_driver', 'username');
|
||||
}),
|
||||
(new Extend\Settings())
|
||||
->serializeToForum('displayNameDriver', 'display_name_driver', null, 'username'),
|
||||
|
||||
(new Extend\Validator(UserValidator::class))
|
||||
->configure(AddNicknameValidation::class),
|
||||
|
|
Loading…
Reference in New Issue
Block a user