refactor(ui): refactor accesses state using zustand store

This commit is contained in:
Fu Diwei
2024-12-11 19:55:50 +08:00
parent b744363736
commit bb3009a124
48 changed files with 359 additions and 404 deletions

View File

@@ -1,3 +1,4 @@
import { Statistics } from "@/domain/statistics";
import { getPocketBase } from "@/repository/pocketbase";
export const get = async () => {
@@ -7,9 +8,9 @@ export const get = async () => {
method: "GET",
});
if (resp.code != 0) {
if (resp.code !== 0) {
throw new Error(resp.msg);
}
return resp.data;
return resp.data as Statistics;
};