mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
fix album grouping on user pictures page
This commit is contained in:
@ -22,11 +22,11 @@ document.addEventListener("alpine:init", () => {
|
||||
} as PicturesFetchPicturesData);
|
||||
|
||||
this.albums = this.pictures.reduce(
|
||||
(acc: Record<string, PictureSchema[]>, picture: PictureSchema) => {
|
||||
if (!acc[picture.album]) {
|
||||
acc[picture.album] = [];
|
||||
(acc: Record<number, PictureSchema[]>, picture: PictureSchema) => {
|
||||
if (!acc[picture.album.id]) {
|
||||
acc[picture.album.id] = [];
|
||||
}
|
||||
acc[picture.album].push(picture);
|
||||
acc[picture.album.id].push(picture);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
|
Reference in New Issue
Block a user