toggle favorite inspiration working + tab my favorite

This commit is contained in:
isUnknown 2024-09-11 08:05:35 +02:00
parent 0a412d48a4
commit 0ee0181206
6 changed files with 41 additions and 14 deletions

View file

@ -2,7 +2,7 @@ Alt:
----
Favoriteforusers:
Favoriteforusers: - user://HfuumN8s
----

View file

@ -1,3 +1,11 @@
Alt:
----
Favoriteforusers:
----
Description:
----

View file

@ -2,7 +2,10 @@ Alt:
----
Favoriteforusers: - user://WWjXgPWk
Favoriteforusers:
- user://WWjXgPWk
- user://HfuumN8s
----

View file

@ -28,10 +28,10 @@ return [
$array = $favoriteForUsers->toArray();
$yaml = Data::encode($array, 'yaml');
$file->update([
$newFile = $file->update([
'favoriteForUsers' => $yaml
]);
return json_encode('Image ' . $action . ' favoris de l\'utilisateur ' . $user->email() . '.');
return json_encode($newFile->favoriteForUsers()->value());
}
];