fix: allowing nullable user lists
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user