mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-07 13:42:34 +00:00
feat: update workspace detail page
This commit is contained in:
@ -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