Use Settings extender serializeToForum properly now that it supports defaults.

This commit is contained in:
Alexander Skvortsov 2021-03-13 17:18:55 -05:00
parent 8266966fec
commit f2b2a26caf

View File

@ -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),