You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -9,11 +9,14 @@ use Illuminate\Http\Request;
|
||||
|
||||
class ReactionService
|
||||
{
|
||||
/**
|
||||
* @return array{success: bool, added?: bool, username?: string}
|
||||
*/
|
||||
public function toggleReaction(WebsiteArticle $article, User $user, Request $request): array
|
||||
{
|
||||
$reaction = $request->get('reaction');
|
||||
|
||||
if (! is_string($reaction) || ! in_array($reaction, config('habbo.reactions'))) {
|
||||
if (! is_string($reaction) || ! in_array($reaction, (array) config('habbo.reactions'))) {
|
||||
return ['success' => false];
|
||||
}
|
||||
|
||||
@@ -29,7 +32,7 @@ class ReactionService
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'added' => $existingReaction?->active ?? true,
|
||||
'added' => $existingReaction ? $existingReaction->active : true,
|
||||
'username' => $user->username,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user