fix: allowing nullable user lists

This commit is contained in:
2025-08-30 10:53:10 +01:00
parent f7c9c97f0a
commit e45688d57e

View File

@ -99,13 +99,13 @@ const userImageValidator = strictObject({
UserID: pipe(string(), uuid()),
Image: strictObject({
...imageMetaValidator.entries,
ImageLists: array(
ImageLists: pipe(nullable(array(
strictObject({
ID: pipe(string(), uuid()),
ImageID: pipe(string(), uuid()),
ListID: pipe(string(), uuid()),
}),
),
)), transform(l => l ?? [])),
}),
});
@ -183,6 +183,8 @@ export const getUserImages = async (): Promise<
const res = await fetch(request).then((res) => res.json());
console.log("Backend response: ", res);
return parse(imageRequestValidator, res);
};