mirror of
https://github.com/docmost/docmost.git
synced 2026-08-28 01:07:08 +08:00
endpoint refactor
This commit is contained in:
@@ -9,29 +9,29 @@ import {
|
||||
} from "@/ee/page-permission/types/page-permission.types";
|
||||
|
||||
export async function restrictPage(pageId: string): Promise<void> {
|
||||
await api.post("/pages/permissions/restrict", { pageId });
|
||||
await api.post("/pages/restrict", { pageId });
|
||||
}
|
||||
|
||||
export async function addPagePermission(
|
||||
data: IAddPagePermission,
|
||||
): Promise<void> {
|
||||
await api.post("/pages/permissions/add-members", data);
|
||||
await api.post("/pages/add-permission", data);
|
||||
}
|
||||
|
||||
export async function removePagePermission(
|
||||
data: IRemovePagePermission,
|
||||
): Promise<void> {
|
||||
await api.post("/pages/permissions/remove-members", data);
|
||||
await api.post("/pages/remove-permission", data);
|
||||
}
|
||||
|
||||
export async function updatePagePermissionRole(
|
||||
data: IUpdatePagePermissionRole,
|
||||
): Promise<void> {
|
||||
await api.post("/pages/permissions/change-role", data);
|
||||
await api.post("/pages/update-permission", data);
|
||||
}
|
||||
|
||||
export async function unrestrictPage(pageId: string): Promise<void> {
|
||||
await api.post("/pages/permissions/unrestrict", { pageId });
|
||||
await api.post("/pages/remove-restriction", { pageId });
|
||||
}
|
||||
|
||||
export async function getPagePermissions(
|
||||
@@ -39,7 +39,7 @@ export async function getPagePermissions(
|
||||
params?: QueryParams,
|
||||
): Promise<IPagination<IPagePermissionMember>> {
|
||||
const req = await api.post<IPagination<IPagePermissionMember>>(
|
||||
"/pages/permissions/members",
|
||||
"/pages/permissions",
|
||||
{ pageId, ...params },
|
||||
);
|
||||
return req.data;
|
||||
@@ -48,7 +48,7 @@ export async function getPagePermissions(
|
||||
export async function getPageRestrictionInfo(
|
||||
pageId: string,
|
||||
): Promise<IPageRestrictionInfo> {
|
||||
const req = await api.post<IPageRestrictionInfo>("/pages/permissions/info", {
|
||||
const req = await api.post<IPageRestrictionInfo>("/pages/permission-info", {
|
||||
pageId,
|
||||
});
|
||||
return req.data;
|
||||
|
||||
Reference in New Issue
Block a user