fix: minor fixes for the frontend
All checks were successful
Build and Deploy Go App / build (push) Successful in 5m46s
Build and Deploy Go App / deploy (push) Successful in 36s

This commit is contained in:
nihonium 2025-12-04 13:01:10 +03:00
parent 3f3cc5c484
commit 5d1d138aca
Signed by: nihonium
GPG key ID: 0251623741027CFC
3 changed files with 7 additions and 5 deletions

View file

@ -23,7 +23,6 @@ const STATUS_BUTTONS: { status: UserTitleStatus; icon: React.ReactNode; label: s
export function TitleStatusControls({ titleId }: { titleId: number }) {
const [cookies] = useCookies(['xsrf_token']);
const xsrfToken = cookies['xsrf_token'] || null;
console.log("xsrf_token: " + xsrfToken)
const [currentStatus, setCurrentStatus] = useState<UserTitleStatus | null>(null);
const [loading, setLoading] = useState(false);
@ -56,7 +55,9 @@ export function TitleStatusControls({ titleId }: { titleId: number }) {
await deleteUserTitle({path: {
user_id: userId,
title_id: titleId,
}})
},
headers: { "X-XSRF-TOKEN": xsrfToken },
})
setCurrentStatus(null);
return;
}
@ -73,7 +74,8 @@ export function TitleStatusControls({ titleId }: { titleId: number }) {
title_id: titleId,
status: status,
},
path: {user_id: userId}
path: {user_id: userId},
headers: { "X-XSRF-TOKEN": xsrfToken },
});
setCurrentStatus(added.data?.status ?? null);

View file

@ -96,7 +96,7 @@ export default function UserPage({ userId }: UserPageProps) {
// "all"
// );
if (!result?.data?.data.length) return { items: [], nextCursor: null };
if (!result?.data?.data?.length) return { items: [], nextCursor: null };
return { items: result.data?.data, nextCursor: result.data?.cursor ?? null };
} catch (err: any) {