Skip to content

Commit d0dd1cf

Browse files
committed
Improve workspace creation
1 parent c0f01f4 commit d0dd1cf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/Http/Controllers/WorkspaceController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public function create(Request $request)
7373

7474
return $this->success([
7575
'message' => 'Workspace created.',
76-
'workspace_id' => $workspace->id
76+
'workspace_id' => $workspace->id,
77+
'workspace' => new WorkspaceResource($workspace)
7778
]);
7879
}
7980
}

client/pages/settings/workspace.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ const isUrl = (str) => {
201201
return !!pattern.test(str)
202202
}
203203
const createWorkspace = () => {
204-
form.post('/open/workspaces/create').then((response) => {
205-
fetchAllWorkspaces()
204+
form.post('/open/workspaces/create').then((data) => {
205+
workspacesStore.save(data.workspace)
206+
workspacesStore.currentId = data.workspace.id
206207
workspaceModal.value = false
207-
useAlert().success('Workspace successfully created.')
208+
useAlert().success('Workspace successfully created! You are now editing settings for your new workspace.')
208209
})
209210
}
210211

0 commit comments

Comments
 (0)