mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-18 02:19:51 +00:00
19 lines
465 B
TypeScript
19 lines
465 B
TypeScript
import { ClientResponseError } from "pocketbase";
|
|
|
|
import { type Statistics } from "@/domain/statistics";
|
|
import { getPocketBase } from "@/repository/pocketbase";
|
|
|
|
export const get = async () => {
|
|
const pb = getPocketBase();
|
|
|
|
const resp = await pb.send<BaseResponse<Statistics>>("/api/statistics/get", {
|
|
method: "GET",
|
|
});
|
|
|
|
if (resp.code != 0) {
|
|
throw new ClientResponseError({ status: resp.code, response: resp, data: {} });
|
|
}
|
|
|
|
return resp;
|
|
};
|