mirror of
https://github.com/aykhans/slash-e.git
synced 2026-10-06 02:45:17 +00:00
feat: update workspace detail page
This commit is contained in:
1 parent
922f8e6f95
commit
572a93c5f0
9 files changed
+94
-121
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import * as api from "../helpers/api";
|
||||
import store from "../store";
|
||||
import { createWorkspace, deleteWorkspace, patchWorkspace, setWorkspaceList } from "../store/modules/workspace";
|
||||
import { createWorkspace, deleteWorkspace, patchWorkspace, setWorkspaceById, setWorkspaceList } from "../store/modules/workspace";
|
||||
|
||||
const convertResponseModelWorkspace = (workspace: Workspace): Workspace => {
|
||||
return {
|
||||
@@ -22,6 +22,13 @@ const workspaceService = {
|
||||
return workspaces;
|
||||
},
|
||||
|
||||
fetchWorkspaceById: async (workspaceId: WorkspaceId) => {
|
||||
const { data } = (await api.getWorkspaceById(workspaceId)).data;
|
||||
const workspace = convertResponseModelWorkspace(data);
|
||||
store.dispatch(setWorkspaceById(workspace));
|
||||
return workspace;
|
||||
},
|
||||
|
||||
getWorkspaceByName: (workspaceName: string) => {
|
||||
const workspaceList = workspaceService.getState().workspaceList;
|
||||
for (const workspace of workspaceList) {
|
||||
|
||||
Reference in new issue
Block a user