diff options
Diffstat (limited to 'src/api/server/ServerApi.js')
-rw-r--r-- | src/api/server/ServerApi.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 164419951..2871769a9 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -42,6 +42,7 @@ const API_VERSION = 'v1'; | |||
42 | 42 | ||
43 | export default class ServerApi { | 43 | export default class ServerApi { |
44 | recipePreviews = []; | 44 | recipePreviews = []; |
45 | |||
45 | recipes = []; | 46 | recipes = []; |
46 | 47 | ||
47 | // User | 48 | // User |
@@ -522,8 +523,7 @@ export default class ServerApi { | |||
522 | const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/recipes/${s.service}`, | 523 | const request = await window.fetch(`${SERVER_URL}/${API_VERSION}/recipes/${s.service}`, |
523 | this._prepareAuthRequest({ | 524 | this._prepareAuthRequest({ |
524 | method: 'GET', | 525 | method: 'GET', |
525 | }), | 526 | })); |
526 | ); | ||
527 | 527 | ||
528 | if (request.status === 200) { | 528 | if (request.status === 200) { |
529 | const data = await request.json(); | 529 | const data = await request.json(); |
@@ -549,9 +549,9 @@ export default class ServerApi { | |||
549 | 549 | ||
550 | await this._bulkRecipeCheck(recipes); | 550 | await this._bulkRecipeCheck(recipes); |
551 | 551 | ||
552 | return Promise.all(services | 552 | /* eslint-disable no-return-await */ |
553 | .map(async service => await this._prepareServiceModel(service)) // eslint-disable-line | 553 | return Promise.all(services.map(async service => await this._prepareServiceModel(service))); |
554 | ); | 554 | /* eslint-enable no-return-await */ |
555 | } | 555 | } |
556 | 556 | ||
557 | async _prepareServiceModel(service) { | 557 | async _prepareServiceModel(service) { |
@@ -596,8 +596,7 @@ export default class ServerApi { | |||
596 | } | 596 | } |
597 | 597 | ||
598 | return recipe; | 598 | return recipe; |
599 | }), | 599 | })).catch(err => console.error('Can\'t load recipe', err)); |
600 | ).catch(err => console.error('Can\'t load recipe', err)); | ||
601 | } | 600 | } |
602 | 601 | ||
603 | _mapRecipePreviewModel(recipes) { | 602 | _mapRecipePreviewModel(recipes) { |