Notify push test
This commit is contained in:
22
ui/src/api/notify.ts
Normal file
22
ui/src/api/notify.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { getPb } from "@/repository/api";
|
||||
|
||||
export const notifyTest = async (channel: string) => {
|
||||
const pb = getPb();
|
||||
|
||||
const resp = await pb.send("/api/notify/test", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: {
|
||||
channel,
|
||||
},
|
||||
});
|
||||
|
||||
if (resp.code != 0) {
|
||||
throw new Error(resp.msg);
|
||||
}
|
||||
|
||||
return resp;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user