fix: allowing nullable user lists
This commit is contained in:
@ -99,13 +99,13 @@ const userImageValidator = strictObject({
|
|||||||
UserID: pipe(string(), uuid()),
|
UserID: pipe(string(), uuid()),
|
||||||
Image: strictObject({
|
Image: strictObject({
|
||||||
...imageMetaValidator.entries,
|
...imageMetaValidator.entries,
|
||||||
ImageLists: array(
|
ImageLists: pipe(nullable(array(
|
||||||
strictObject({
|
strictObject({
|
||||||
ID: pipe(string(), uuid()),
|
ID: pipe(string(), uuid()),
|
||||||
ImageID: pipe(string(), uuid()),
|
ImageID: pipe(string(), uuid()),
|
||||||
ListID: 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());
|
const res = await fetch(request).then((res) => res.json());
|
||||||
|
|
||||||
|
console.log("Backend response: ", res);
|
||||||
|
|
||||||
return parse(imageRequestValidator, res);
|
return parse(imageRequestValidator, res);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user