mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-17 16:40:05 +00:00
26 lines
547 B
TypeScript
26 lines
547 B
TypeScript
import { Deployment, DeploymentListReq } from "@/domain/deployment";
|
|
import { getPb } from "./api";
|
|
|
|
export const list = async (req: DeploymentListReq) => {
|
|
let page = 1;
|
|
if (req.page) {
|
|
page = req.page;
|
|
}
|
|
|
|
let perPage = 50;
|
|
if (req.perPage) {
|
|
perPage = req.perPage;
|
|
}
|
|
|
|
let filter = "domain!=null";
|
|
if (req.domain) {
|
|
filter = `domain="${req.domain}"`;
|
|
}
|
|
|
|
return await getPb().collection("deployments").getList<Deployment>(page, perPage, {
|
|
filter: filter,
|
|
sort: "-deployedAt",
|
|
expand: "domain",
|
|
});
|
|
};
|