diff --git a/app/Http/Resources/UserProfileSettingsResource.php b/app/Http/Resources/UserProfileSettingsResource.php index 21d8168af..cbf2ad5e6 100644 --- a/app/Http/Resources/UserProfileSettingsResource.php +++ b/app/Http/Resources/UserProfileSettingsResource.php @@ -22,6 +22,8 @@ * @OA\Property(property="mastodon", type="string", example="https://mastodon.social/@Gertrud123"), * @OA\Property(property="mastodonVisibility", ref="#/components/schemas/MastodonVisibility"), * @OA\Property(property="friendCheckin", ref="#/components/schemas/FriendCheckinSetting"), + * @OA\Property(property="likesEnabled", type="boolean", example=true), + * @OA\Property(property="pointsEnabled", type="boolean", example=true), * ) */ class UserProfileSettingsResource extends JsonResource @@ -42,6 +44,8 @@ public function toArray($request): array { 'mastodon' => $this->mastodon_url, 'mastodonVisibility' => $this->socialProfile->mastodon_visibility->value, 'friendCheckin' => $this->friend_checkin?->value, + 'likesEnabled' => (bool) $this->likes_enabled, + 'pointsEnabled' => (bool) $this->points_enabled, ]; } } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 487439353..62829b698 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -25,6 +25,7 @@ public function definition(): array { 'privacy_hide_days' => $this->faker->numberBetween(7, 365), 'language' => null, 'likes_enabled' => true, + 'points_enabled' => true, 'friend_checkin' => FriendCheckinSetting::FORBIDDEN, ]; } diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index d7084b492..8011de99e 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -5415,6 +5415,14 @@ }, "friendCheckin": { "$ref": "#/components/schemas/FriendCheckinSetting" + }, + "likesEnabled": { + "type": "boolean", + "example": true + }, + "pointsEnabled": { + "type": "boolean", + "example": true } }, "type": "object" diff --git a/tests/Feature/APIv1/SettingsTest.php b/tests/Feature/APIv1/SettingsTest.php index 279258d8b..eb701fe6e 100644 --- a/tests/Feature/APIv1/SettingsTest.php +++ b/tests/Feature/APIv1/SettingsTest.php @@ -30,6 +30,8 @@ public function testGetProfileSettings(): void { ]); $this->assertEquals(FriendCheckinSetting::FORBIDDEN->value, $response->json('data.friendCheckin')); + $this->assertTrue($response->json('data.likesEnabled')); + $this->assertTrue($response->json('data.pointsEnabled')); } public function testUpdateProfileSettings(): void {