mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 07:41:16 +10:00
space updates
* space UI * space management * space permissions * other fixes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import api from "@/lib/api-client";
|
||||
import { IUser } from "@/features/user/types/user.types";
|
||||
import { IWorkspace } from "../types/workspace.types";
|
||||
import { QueryParams } from "@/lib/types.ts";
|
||||
import { IPagination, QueryParams } from "@/lib/types.ts";
|
||||
|
||||
export async function getWorkspace(): Promise<IWorkspace> {
|
||||
const req = await api.post<IWorkspace>("/workspace/info");
|
||||
@ -9,8 +9,10 @@ export async function getWorkspace(): Promise<IWorkspace> {
|
||||
}
|
||||
|
||||
// Todo: fix all paginated types
|
||||
export async function getWorkspaceMembers(params?: QueryParams): Promise<any> {
|
||||
const req = await api.post<any>("/workspace/members", params);
|
||||
export async function getWorkspaceMembers(
|
||||
params?: QueryParams,
|
||||
): Promise<IPagination<IUser>> {
|
||||
const req = await api.post("/workspace/members", params);
|
||||
return req.data;
|
||||
}
|
||||
|
||||
@ -19,3 +21,10 @@ export async function updateWorkspace(data: Partial<IWorkspace>) {
|
||||
|
||||
return req.data as IWorkspace;
|
||||
}
|
||||
|
||||
export async function changeMemberRole(data: {
|
||||
userId: string;
|
||||
role: string;
|
||||
}): Promise<void> {
|
||||
await api.post("/workspace/members/role", data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user