added persisting tokenID after password changes on changing session

This commit is contained in:
z1glr
2025-01-11 17:31:18 +00:00
parent b8ede7ef36
commit 4f86dce569
5 changed files with 48 additions and 35 deletions

View File

@@ -90,3 +90,23 @@ export function vaidatePassword(password: string): string[] {
return errors;
}
export interface Task {
text: string;
disabled: boolean;
}
export async function getTasks(): Promise<Record<number, Task>> {
const result = await apiCall<{ text: string; disabled: boolean }[]>(
"GET",
"tasks",
);
if (result.ok) {
const tasks = await result.json();
return tasks;
} else {
return [];
}
}