Files
.github
.vscode
docker
internal
migrations
ui
public
src
api
certificates.ts
notify.ts
statistics.ts
workflows.ts
components
domain
hooks
i18n
pages
repository
stores
utils
App.tsx
declarations.d.ts
global.css
index.css
main.tsx
router.tsx
types
.eslintrc.cjs
.gitignore
.prettierrc.cjs
components.json
embed.go
index.html
package-lock.json
package.json
postcss.config.js
tailwind.config.js
tsconfig.app.json
tsconfig.json
tsconfig.node.json
vite.config.ts
.dockerignore
.editorconfig
.gitignore
.goreleaser.yml
CHANGELOG.md
CONTRIBUTING.md
CONTRIBUTING_EN.md
Dockerfile
LICENSE.md
Makefile
README.md
README_EN.md
go.mod
go.sum
main.go
nixpacks.toml
usage.gif
certimate/ui/src/api/statistics.ts
2025-01-18 07:09:41 +08:00

19 lines
466 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;
};