style: format

This commit is contained in:
Fu Diwei
2024-10-15 20:45:39 +08:00
parent b0923d54ee
commit 7ef885319e
184 changed files with 2080 additions and 10779 deletions

View File

@@ -1,14 +1,12 @@
import { Access } from "@/domain/access";
import { AccessGroup } from "@/domain/access_groups";
import { getPb } from "./api";
import { Access } from "@/domain/access";
export const list = async () => {
const resp = await getPb()
.collection("access_groups")
.getFullList<AccessGroup>({
sort: "-created",
expand: "access",
});
const resp = await getPb().collection("access_groups").getFullList<AccessGroup>({
sort: "-created",
expand: "access",
});
return resp;
};
@@ -31,9 +29,7 @@ export const remove = async (id: string) => {
export const update = async (accessGroup: AccessGroup) => {
const pb = getPb();
if (accessGroup.id) {
return await pb
.collection("access_groups")
.update(accessGroup.id, accessGroup);
return await pb.collection("access_groups").update(accessGroup.id, accessGroup);
}
return await pb.collection("access_groups").create(accessGroup);
};