Skip to content

Commit 34d3eb1

Browse files
committed
[Twitch] Update JSON response in the /twitch base endpoint
1 parent 1b9b320 commit 34d3eb1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

app/Http/Controllers/TwitchController.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function base()
157157
'clusters' => 'clusters/{CHANNEL}',
158158
'followage' => 'followage/{CHANNEL}/{USER}',
159159
'followed' => 'followed/{USER}/{CHANNEL}',
160-
'followers' => 'followed/{CHANNEL}',
160+
'followers' => 'followers/{CHANNEL}',
161161
'following' => 'following/{USER}',
162162
'game' => 'game/{CHANNEL}',
163163
'help' => 'help/{SEARCH}',
@@ -178,12 +178,13 @@ public function base()
178178
'vod_replay' => 'vod_replay/{CHANNEL}',
179179
];
180180

181-
foreach ($urls as $name => $endpoint) {
182-
$urls[$name] = $baseUrl . '/' . $endpoint;
183-
}
181+
$urls = array_map(function($path) use($baseUrl) {
182+
return sprintf('%s/%s', $baseUrl, $path);
183+
}, $urls);
184184

185185
return $this->json([
186-
'endpoints' => $urls
186+
'documentation' => 'https://docs.decapi.me/twitch',
187+
'endpoints' => $urls,
187188
]);
188189
}
189190

0 commit comments

Comments
 (0)