Improve workspace creation

This commit is contained in:
Julien Nahum 2024-01-22 14:40:17 +01:00
parent c0f01f4b84
commit d0dd1cfe39
2 changed files with 6 additions and 4 deletions

View File

@ -73,7 +73,8 @@ class WorkspaceController extends Controller
return $this->success([ return $this->success([
'message' => 'Workspace created.', 'message' => 'Workspace created.',
'workspace_id' => $workspace->id 'workspace_id' => $workspace->id,
'workspace' => new WorkspaceResource($workspace)
]); ]);
} }
} }

View File

@ -201,10 +201,11 @@ const isUrl = (str) => {
return !!pattern.test(str) return !!pattern.test(str)
} }
const createWorkspace = () => { const createWorkspace = () => {
form.post('/open/workspaces/create').then((response) => { form.post('/open/workspaces/create').then((data) => {
fetchAllWorkspaces() workspacesStore.save(data.workspace)
workspacesStore.currentId = data.workspace.id
workspaceModal.value = false workspaceModal.value = false
useAlert().success('Workspace successfully created.') useAlert().success('Workspace successfully created! You are now editing settings for your new workspace.')
}) })
} }