certificate display

This commit is contained in:
yoan
2024-11-21 13:17:39 +08:00
parent 2d10fa0218
commit 09e4b24445
15 changed files with 331 additions and 45 deletions

View File

@@ -0,0 +1,28 @@
import { Certificate } from "@/domain/certificate";
import { getPb } from "./api";
type CertificateListReq = {
page?: number;
perPage?: number;
};
export const list = async (req: CertificateListReq) => {
const pb = getPb();
let page = 1;
if (req.page) {
page = req.page;
}
let perPage = 2;
if (req.perPage) {
perPage = req.perPage;
}
const response = pb.collection("certificate").getList<Certificate>(page, perPage, {
sort: "-created",
expand: "workflow",
});
return response;
};

View File

@@ -65,4 +65,3 @@ export const logs = async (req: WorkflowLogsReq) => {
return response;
};