mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-24 05:09:56 +00:00
24 lines
517 B
TypeScript
24 lines
517 B
TypeScript
import { ClientResponseError } from "pocketbase";
|
|
|
|
import { getPocketBase } from "@/repository/_pocketbase";
|
|
|
|
export const notifyTest = async (channel: string) => {
|
|
const pb = getPocketBase();
|
|
|
|
const resp = await pb.send<BaseResponse>("/api/notify/test", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: {
|
|
channel,
|
|
},
|
|
});
|
|
|
|
if (resp.code != 0) {
|
|
throw new ClientResponseError({ status: resp.code, response: resp, data: {} });
|
|
}
|
|
|
|
return resp;
|
|
};
|