Skip to content

Commit d5c35c2

Browse files
committed
Update LinkLimitService
1 parent 8b99ab7 commit d5c35c2

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

app/Http/Controllers/Api/AccountController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,12 @@ public function defaultCursorTokenResponse($request, $limit)
765765
public function getProfileLinks(Request $request)
766766
{
767767
$profile = $request->user()->profile;
768-
$res = $profile->profileLinks()->orderBy('position')->get();
768+
$links = $profile->profileLinks()->orderBy('position')->get();
769+
$res = [
770+
'available_slots' => LinkLimitService::getRemainingSlots($profile),
771+
'can_add' => (bool) LinkLimitService::canAddLink($profile),
772+
'links' => $links,
773+
];
769774

770775
return $this->data($res);
771776
}

app/Services/LinkLimitService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ class LinkLimitService
1818

1919
private const TIER_1_THRESHOLD = 100;
2020

21-
private const TIER_2_THRESHOLD = 2000;
21+
private const TIER_2_THRESHOLD = 1500;
2222

23-
private const TIER_3_THRESHOLD = 5000;
23+
private const TIER_3_THRESHOLD = 2000;
2424

25-
private const TIER_4_THRESHOLD = 10000;
25+
private const TIER_4_THRESHOLD = 2300;
2626

2727
public static function getMaxLinks(Profile $profile): int
2828
{

0 commit comments

Comments
 (0)