feat: allowing user to get a list of their images
feat: UI to show and organise user images
This commit is contained in:
16
frontend/src/utils/groupPropertiesWithImage.ts
Normal file
16
frontend/src/utils/groupPropertiesWithImage.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { getUserImages } from "../network";
|
||||
|
||||
export const groupPropertiesWithImage = ({
|
||||
UserImages,
|
||||
ImageProperties,
|
||||
}: Awaited<ReturnType<typeof getUserImages>>) => {
|
||||
const imageToProperties: Record<string, typeof ImageProperties> = {};
|
||||
|
||||
for (const image of UserImages) {
|
||||
imageToProperties[image.ImageID] = ImageProperties.filter((i) =>
|
||||
i.data.Images.includes(image.ImageID),
|
||||
);
|
||||
}
|
||||
|
||||
return imageToProperties;
|
||||
};
|
||||
Reference in New Issue
Block a user