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

@@ -4,16 +4,10 @@ import { create } from "zustand";
import { persist } from "zustand/middleware";
import { apiCall } from "./lib";
export type Task = string;
export type Availability = string;
export const Availabilities: Availability[] = ["yes", "maybe", "no"];
export interface EventData {
id: number;
date: string;
tasks: Partial<Record<Task, string | null>>;
tasks: Partial<Record<string, string | null>>;
description: string;
}
@@ -70,21 +64,4 @@ const zustand = create<Zustand>()(
),
);
export async function getTasks(): Promise<
Record<number, { text: string; disabled: boolean }>
> {
const result = await apiCall<{ text: string; disabled: boolean }[]>(
"GET",
"tasks",
);
if (result.ok) {
const tasks = await result.json();
return tasks;
} else {
return [];
}
}
export default zustand;