Implement breaking api changes

This commit is contained in:
regalijan 2023-10-19 16:50:57 -04:00
parent 4a0f769514
commit 88c317c5db
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -78,7 +78,13 @@ export default function () {
});
}
const history: { [k: string]: any }[] = await historyResp.json();
const {
history,
user,
}: {
history: { [k: string]: any }[];
user: { avatar: string | null; id: number; name: string };
} = await historyResp.json();
if (!history.length) {
setLoading(false);
@ -93,7 +99,8 @@ export default function () {
setHasResults(true);
const cardList = [];
setUid(history[history.length - 1].entity.properties.target.integerValue);
setAvatarUrl(user.avatar ?? "https://i.hep.gg/floppa");
setUid(user.id.toString());
setStatus(history[history.length - 1].entity.properties.action.stringValue);
for (const entry of history) {