mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 19:36:38 +00:00
✨ approval list UI
This commit is contained in:
@@ -21,6 +21,7 @@ import type {
|
||||
} from "@server/routers/resource";
|
||||
import type { ListTargetsResponse } from "@server/routers/target";
|
||||
import type { ListDomainsResponse } from "@server/routers/domain";
|
||||
import type { ListApprovalsResponse } from "@server/private/routers/approvals";
|
||||
|
||||
export type ProductUpdate = {
|
||||
link: string | null;
|
||||
@@ -311,3 +312,25 @@ export const resourceQueries = {
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
export const approvalFiltersSchema = z.object({
|
||||
approvalState: z
|
||||
.enum(["pending", "approved", "denied", "all"])
|
||||
.optional()
|
||||
.catch("pending")
|
||||
});
|
||||
|
||||
export const approvalQueries = {
|
||||
listApprovals: (orgId: string) =>
|
||||
queryOptions({
|
||||
queryKey: ["APPROVALS", orgId] as const,
|
||||
queryFn: async ({ signal, meta }) => {
|
||||
const res = await meta!.api.get<
|
||||
AxiosResponse<ListApprovalsResponse>
|
||||
>(`/org/${orgId}/approvals`, {
|
||||
signal
|
||||
});
|
||||
return res.data.data;
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user