mirror of
https://github.com/docmost/docmost.git
synced 2025-11-20 10:11:09 +10:00
implement new invitation system
* fix comments on the frontend * move jwt token service to its own module * other fixes and updates
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import api from "@/lib/api-client";
|
||||
import {
|
||||
ICommentParams,
|
||||
IComment,
|
||||
IResolveComment,
|
||||
} from "@/features/comment/types/comment.types";
|
||||
@ -9,30 +10,30 @@ export async function createComment(
|
||||
data: Partial<IComment>,
|
||||
): Promise<IComment> {
|
||||
const req = await api.post<IComment>("/comments/create", data);
|
||||
return req.data as IComment;
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function resolveComment(data: IResolveComment): Promise<IComment> {
|
||||
const req = await api.post<IComment>(`/comments/resolve`, data);
|
||||
return req.data as IComment;
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function updateComment(
|
||||
data: Partial<IComment>,
|
||||
): Promise<IComment> {
|
||||
const req = await api.post<IComment>(`/comments/update`, data);
|
||||
return req.data as IComment;
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function getCommentById(commentId: string): Promise<IComment> {
|
||||
const req = await api.post<IComment>("/comments/info", { commentId });
|
||||
return req.data as IComment;
|
||||
return req.data;
|
||||
}
|
||||
|
||||
export async function getPageComments(
|
||||
pageId: string,
|
||||
data: ICommentParams,
|
||||
): Promise<IPagination<IComment>> {
|
||||
const req = await api.post("/comments", { pageId });
|
||||
const req = await api.post("/comments", data);
|
||||
return req.data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user