diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-12-02 23:57:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 04:27:13 +0530 |
commit | f64f1b3bd9bec4036748b98ff8ac0f0431749f30 (patch) | |
tree | 33691b4b02a546a7a1665ca29b18e3baa135c9ef /src/internal-server/app/Controllers/Http/WorkspaceController.js | |
parent | 5.6.4-nightly.22 [skip ci] (diff) | |
download | ferdium-app-f64f1b3bd9bec4036748b98ff8ac0f0431749f30.tar.gz ferdium-app-f64f1b3bd9bec4036748b98ff8ac0f0431749f30.tar.zst ferdium-app-f64f1b3bd9bec4036748b98ff8ac0f0431749f30.zip |
chore: upgrade commitlint and eslint-plugin-unicorn to latest (#2295)
- upgrade commitlint and eslint-plugin-unicorn dependencies
- update prepare-code script to run lint:fix instead of lint
- fix unicorn/no-await-expression-member lint issues
- various whitespace formatting fixes due to lint:fix
Diffstat (limited to 'src/internal-server/app/Controllers/Http/WorkspaceController.js')
-rw-r--r-- | src/internal-server/app/Controllers/Http/WorkspaceController.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/internal-server/app/Controllers/Http/WorkspaceController.js b/src/internal-server/app/Controllers/Http/WorkspaceController.js index 528721f13..9ba2b174e 100644 --- a/src/internal-server/app/Controllers/Http/WorkspaceController.js +++ b/src/internal-server/app/Controllers/Http/WorkspaceController.js | |||
@@ -25,11 +25,13 @@ class WorkspaceController { | |||
25 | do { | 25 | do { |
26 | workspaceId = uuid(); | 26 | workspaceId = uuid(); |
27 | } while ( | 27 | } while ( |
28 | // eslint-disable-next-line no-await-in-loop, unicorn/no-await-expression-member | ||
28 | (await Workspace.query().where('workspaceId', workspaceId).fetch()).rows | 29 | (await Workspace.query().where('workspaceId', workspaceId).fetch()).rows |
29 | .length > 0 | 30 | .length > 0 |
30 | ); | 31 | ); |
31 | 32 | ||
32 | const order = (await Workspace.all()).rows.length; | 33 | const allWorkspaces = await Workspace.all(); |
34 | const order = allWorkspaces.rows.length; | ||
33 | const { name } = data; | 35 | const { name } = data; |
34 | delete data.name; | 36 | delete data.name; |
35 | 37 | ||
@@ -76,8 +78,10 @@ class WorkspaceController { | |||
76 | }); | 78 | }); |
77 | 79 | ||
78 | // Get updated row | 80 | // Get updated row |
79 | const workspace = (await Workspace.query().where('workspaceId', id).fetch()) | 81 | const workspaceQuery = await Workspace.query() |
80 | .rows[0]; | 82 | .where('workspaceId', id) |
83 | .fetch(); | ||
84 | const workspace = workspaceQuery.rows[0]; | ||
81 | 85 | ||
82 | return response.send({ | 86 | return response.send({ |
83 | id: workspace.workspaceId, | 87 | id: workspace.workspaceId, |
@@ -118,7 +122,8 @@ class WorkspaceController { | |||
118 | 122 | ||
119 | // List all workspaces a user has created | 123 | // List all workspaces a user has created |
120 | async list({ response }) { | 124 | async list({ response }) { |
121 | const workspaces = (await Workspace.all()).rows; | 125 | const allWorkspaces = await Workspace.all(); |
126 | const workspaces = allWorkspaces.rows; | ||
122 | // Convert to array with all data Franz wants | 127 | // Convert to array with all data Franz wants |
123 | let workspacesArray = []; | 128 | let workspacesArray = []; |
124 | if (workspaces) { | 129 | if (workspaces) { |