diff options
author | 2021-09-06 13:17:41 +0530 | |
---|---|---|
committer | 2021-09-06 13:17:41 +0530 | |
commit | c20567faee5542688351f8dc86eeddb687790499 (patch) | |
tree | 11212992e117a49093c4a724d11dbc507ba71d2f /src/internal-server/app/Controllers/Http | |
parent | fix: Import previously exported `ferdi.data` file (with workspaces) threw err... (diff) | |
download | ferdium-app-c20567faee5542688351f8dc86eeddb687790499.tar.gz ferdium-app-c20567faee5542688351f8dc86eeddb687790499.tar.zst ferdium-app-c20567faee5542688351f8dc86eeddb687790499.zip |
cleanup: Remove redundant 'data.name' in workspaces.
Diffstat (limited to 'src/internal-server/app/Controllers/Http')
-rw-r--r-- | src/internal-server/app/Controllers/Http/WorkspaceController.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/internal-server/app/Controllers/Http/WorkspaceController.js b/src/internal-server/app/Controllers/Http/WorkspaceController.js index 4189fbcdd..773312a0b 100644 --- a/src/internal-server/app/Controllers/Http/WorkspaceController.js +++ b/src/internal-server/app/Controllers/Http/WorkspaceController.js | |||
@@ -32,10 +32,12 @@ class WorkspaceController { | |||
32 | } while ((await Workspace.query().where('workspaceId', workspaceId).fetch()).rows.length > 0); // eslint-disable-line no-await-in-loop | 32 | } while ((await Workspace.query().where('workspaceId', workspaceId).fetch()).rows.length > 0); // eslint-disable-line no-await-in-loop |
33 | 33 | ||
34 | const order = (await Workspace.all()).rows.length; | 34 | const order = (await Workspace.all()).rows.length; |
35 | const name = data.name; | ||
36 | delete data.name; | ||
35 | 37 | ||
36 | await Workspace.create({ | 38 | await Workspace.create({ |
37 | workspaceId, | 39 | workspaceId, |
38 | name: data.name, | 40 | name, |
39 | order, | 41 | order, |
40 | services: JSON.stringify([]), | 42 | services: JSON.stringify([]), |
41 | data: JSON.stringify(data), | 43 | data: JSON.stringify(data), |
@@ -43,7 +45,7 @@ class WorkspaceController { | |||
43 | 45 | ||
44 | return response.send({ | 46 | return response.send({ |
45 | userId: 1, | 47 | userId: 1, |
46 | name: data.name, | 48 | name, |
47 | id: workspaceId, | 49 | id: workspaceId, |
48 | order, | 50 | order, |
49 | workspaces: [], | 51 | workspaces: [], |