refactor: clean code
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { ClientResponseError } from "pocketbase";
|
||||
|
||||
import { getPocketBase } from "@/repository/pocketbase";
|
||||
|
||||
export const run = async (id: string) => {
|
||||
@@ -13,8 +15,8 @@ export const run = async (id: string) => {
|
||||
},
|
||||
});
|
||||
|
||||
if (resp.code != 0) {
|
||||
throw new Error(resp.msg);
|
||||
if (resp.status != 0 && resp.status !== 200) {
|
||||
throw new ClientResponseError({ status: resp.status, response: resp, data: {} });
|
||||
}
|
||||
|
||||
return resp;
|
||||
|
||||
Reference in New Issue
Block a user