mirror of
https://github.com/aykhans/slash-e.git
synced 2025-12-15 21:19:21 +00:00
chore: update frontend modules
This commit is contained in:
@@ -53,59 +53,11 @@ export function deleteUser(userDelete: UserDelete) {
|
||||
return axios.delete(`/api/user/${userDelete.id}`);
|
||||
}
|
||||
|
||||
export function getWorkspaceList(find?: WorkspaceFind) {
|
||||
const queryList = [];
|
||||
if (find?.creatorId) {
|
||||
queryList.push(`creatorId=${find.creatorId}`);
|
||||
}
|
||||
if (find?.memberId) {
|
||||
queryList.push(`memberId=${find.memberId}`);
|
||||
}
|
||||
return axios.get<ResponseObject<Workspace[]>>(`/api/workspace?${queryList.join("&")}`);
|
||||
}
|
||||
|
||||
export function getWorkspaceById(workspaceId: WorkspaceId) {
|
||||
return axios.get<ResponseObject<Workspace>>(`/api/workspace/${workspaceId}`);
|
||||
}
|
||||
|
||||
export function createWorkspace(create: WorkspaceCreate) {
|
||||
return axios.post<ResponseObject<Workspace>>("/api/workspace", create);
|
||||
}
|
||||
|
||||
export function patchWorkspace(patch: WorkspacePatch) {
|
||||
return axios.patch<ResponseObject<Workspace>>(`/api/workspace/${patch.id}`, patch);
|
||||
}
|
||||
|
||||
export function deleteWorkspaceById(workspaceId: WorkspaceId) {
|
||||
return axios.delete(`/api/workspace/${workspaceId}`);
|
||||
}
|
||||
|
||||
export function upsertWorkspaceUser(upsert: WorkspaceUserUpsert) {
|
||||
return axios.post<ResponseObject<WorkspaceUser>>(`/api/workspace/${upsert.workspaceId}/user`, upsert);
|
||||
}
|
||||
|
||||
export function getWorkspaceUserList(workspaceUserFind?: WorkspaceUserFind) {
|
||||
return axios.get<ResponseObject<WorkspaceUser[]>>(`/api/workspace/${workspaceUserFind?.workspaceId}/user`);
|
||||
}
|
||||
|
||||
export function getWorkspaceUser(workspaceUserFind?: WorkspaceUserFind) {
|
||||
return axios.get<ResponseObject<WorkspaceUser>>(
|
||||
`/api/workspace/${workspaceUserFind?.workspaceId}/user/${workspaceUserFind?.userId ?? ""}`
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteWorkspaceUser(workspaceUserDelete: WorkspaceUserDelete) {
|
||||
return axios.delete(`/api/workspace/${workspaceUserDelete.workspaceId}/user/${workspaceUserDelete.userId}`);
|
||||
}
|
||||
|
||||
export function getShortcutList(shortcutFind?: ShortcutFind) {
|
||||
const queryList = [];
|
||||
if (shortcutFind?.creatorId) {
|
||||
queryList.push(`creatorId=${shortcutFind.creatorId}`);
|
||||
}
|
||||
if (shortcutFind?.workspaceId) {
|
||||
queryList.push(`workspaceId=${shortcutFind.workspaceId}`);
|
||||
}
|
||||
return axios.get<ResponseObject<Shortcut[]>>(`/api/shortcut?${queryList.join("&")}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
(() => {
|
||||
if (!String.prototype.replaceAll) {
|
||||
String.prototype.replaceAll = function (str: any, newStr: any) {
|
||||
// If a regex pattern
|
||||
if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") {
|
||||
return this.replace(str, newStr);
|
||||
}
|
||||
|
||||
// If a string
|
||||
return this.replace(new RegExp(str, "g"), newStr);
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
export default null;
|
||||
Reference in New Issue
Block a user