Skip to content

Commit 0c36c26

Browse files
committed
add primitive renaming of groups
1 parent 58d62f8 commit 0c36c26

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/Http/Controllers/TwitchController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,11 @@ public function subEmotes(Request $request, $channel = null)
19201920
$emotesData = $emotes['emotes'];
19211921
$emotesTiers = $plans->sortEmotes($emotesData);
19221922
return $this->json([
1923-
'emotes' => $emotesTiers,
1923+
'emotes' => [
1924+
'tier1' => $emotesTiers['$4.99'],
1925+
'tier2' => $emotesTiers['$9.99'],
1926+
'tier3' => $emotesTiers['$24.99'],
1927+
],
19241928
]);
19251929
}
19261930

app/Http/Resources/TwitchEmotes/Plans.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ public function toArray($request)
2121
];
2222
}
2323

24-
// i have no idea
24+
// sorts emotes by plan name, e.g. all emotes from 4.99 set would be together in one key ("$4.99")
2525
// so yeah.. I know this could be done better
2626
// for example, it could return tier1, tier2, tier3 instead of dollar values
27+
// ^ EDIT: covered in TwitchController though it still feels wrong ^
2728
// how do i do that documentation thing?
2829
public function sortEmotes($emotes)
2930
{

0 commit comments

Comments
 (0)