added persisting tokenID after password changes on changing session
This commit is contained in:
@@ -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 [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user