From d0dd1cfe39e1fad5a23a60090751ccb248921eb5 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 22 Jan 2024 14:40:17 +0100 Subject: [PATCH] Improve workspace creation --- app/Http/Controllers/WorkspaceController.php | 3 ++- client/pages/settings/workspace.vue | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/WorkspaceController.php b/app/Http/Controllers/WorkspaceController.php index 82d8521..dd51121 100644 --- a/app/Http/Controllers/WorkspaceController.php +++ b/app/Http/Controllers/WorkspaceController.php @@ -73,7 +73,8 @@ class WorkspaceController extends Controller return $this->success([ 'message' => 'Workspace created.', - 'workspace_id' => $workspace->id + 'workspace_id' => $workspace->id, + 'workspace' => new WorkspaceResource($workspace) ]); } } diff --git a/client/pages/settings/workspace.vue b/client/pages/settings/workspace.vue index 1674e01..c71a1bd 100644 --- a/client/pages/settings/workspace.vue +++ b/client/pages/settings/workspace.vue @@ -201,10 +201,11 @@ const isUrl = (str) => { return !!pattern.test(str) } const createWorkspace = () => { - form.post('/open/workspaces/create').then((response) => { - fetchAllWorkspaces() + form.post('/open/workspaces/create').then((data) => { + workspacesStore.save(data.workspace) + workspacesStore.currentId = data.workspace.id workspaceModal.value = false - useAlert().success('Workspace successfully created.') + useAlert().success('Workspace successfully created! You are now editing settings for your new workspace.') }) }