mirror of
https://github.com/docmost/docmost.git
synced 2026-05-19 07:54:05 +08:00
feat(ee): page verification workflow (#2102)
* feat: page verification workflow * feat: refactor page-verification * sync * fix type * fix * fix * notification icon * use full word * accept .license file * - update templates - update migration and notification * fix copy * update audit labels * sync * add space name
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import api from "@/lib/api-client";
|
||||
import {
|
||||
IPageVerificationInfo,
|
||||
ISetupVerification,
|
||||
IUpdateVerification,
|
||||
IVerificationListItem,
|
||||
IVerificationListParams,
|
||||
} from "@/ee/page-verification/types/page-verification.types";
|
||||
import { IPagination } from "@/lib/types";
|
||||
|
||||
export async function getVerificationInfo(
|
||||
pageId: string,
|
||||
): Promise<IPageVerificationInfo> {
|
||||
const req = await api.post<IPageVerificationInfo>(
|
||||
"/pages/verification-info",
|
||||
{ pageId },
|
||||
);
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function setupVerification(
|
||||
data: ISetupVerification,
|
||||
): Promise<void> {
|
||||
await api.post("/pages/create-verification", data);
|
||||
}
|
||||
|
||||
export async function updateVerification(
|
||||
data: IUpdateVerification,
|
||||
): Promise<void> {
|
||||
await api.post("/pages/update-verification", data);
|
||||
}
|
||||
|
||||
export async function removeVerification(pageId: string): Promise<void> {
|
||||
await api.post("/pages/delete-verification", { pageId });
|
||||
}
|
||||
|
||||
export async function verifyPage(pageId: string): Promise<void> {
|
||||
await api.post("/pages/verify", { pageId });
|
||||
}
|
||||
|
||||
export async function submitForApproval(pageId: string): Promise<void> {
|
||||
await api.post("/pages/submit-for-approval", { pageId });
|
||||
}
|
||||
|
||||
export async function rejectApproval(data: {
|
||||
pageId: string;
|
||||
comment?: string;
|
||||
}): Promise<void> {
|
||||
await api.post("/pages/reject-approval", data);
|
||||
}
|
||||
|
||||
export async function markObsolete(pageId: string): Promise<void> {
|
||||
await api.post("/pages/mark-obsolete", { pageId });
|
||||
}
|
||||
|
||||
export async function getVerificationList(
|
||||
params?: IVerificationListParams,
|
||||
): Promise<IPagination<IVerificationListItem>> {
|
||||
const req = await api.post("/pages/verifications", { ...params });
|
||||
return req.data;
|
||||
}
|
||||
Reference in New Issue
Block a user