From 9276fe1d51898572ac46db2cbd77adbab825f9f9 Mon Sep 17 00:00:00 2001 From: Maciej Kucharz Date: Tue, 16 Jan 2018 11:51:48 +0100 Subject: [PATCH] fix(): #61 additional (#75) * fix(): small fixes, removing unnecessary comments etc. --- packages/lib-js-core/docs/basics/channels.md | 2 +- packages/lib-js-core/docs/basics/data.md | 2 +- packages/lib-js-core/docs/basics/endpoints.md | 2 +- packages/lib-js-core/docs/basics/events.md | 2 +- packages/lib-js-core/docs/basics/logger.md | 2 +- packages/lib-js-core/docs/basics/responses.md | 2 +- packages/lib-js-core/docs/basics/users.md | 2 +- packages/lib-js-core/src/data.js | 8 -------- packages/lib-js-core/test/e2e/data.js | 4 ++-- 9 files changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/lib-js-core/docs/basics/channels.md b/packages/lib-js-core/docs/basics/channels.md index 909507d0..3b601e6f 100644 --- a/packages/lib-js-core/docs/basics/channels.md +++ b/packages/lib-js-core/docs/basics/channels.md @@ -7,7 +7,7 @@ With `channel` method you're able to: # Import ```js -const {channel} = Server(ctx) +const {channel} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/data.md b/packages/lib-js-core/docs/basics/data.md index 68aec805..a35779d0 100644 --- a/packages/lib-js-core/docs/basics/data.md +++ b/packages/lib-js-core/docs/basics/data.md @@ -7,7 +7,7 @@ With `data` method you're able to: # Import ```js -const {data} = Server(ctx) +const {data} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/endpoints.md b/packages/lib-js-core/docs/basics/endpoints.md index add7b980..800ca7df 100644 --- a/packages/lib-js-core/docs/basics/endpoints.md +++ b/packages/lib-js-core/docs/basics/endpoints.md @@ -7,7 +7,7 @@ With `socket` method you're able to: # Import ```js -const {socket} = Server(ctx) +const {socket} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/events.md b/packages/lib-js-core/docs/basics/events.md index 8b966234..8fae9c66 100644 --- a/packages/lib-js-core/docs/basics/events.md +++ b/packages/lib-js-core/docs/basics/events.md @@ -7,7 +7,7 @@ With `event` method you're able to: # Import ```js -const {event} = Server(ctx) +const {event} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/logger.md b/packages/lib-js-core/docs/basics/logger.md index 5e9762d1..e268c8d7 100644 --- a/packages/lib-js-core/docs/basics/logger.md +++ b/packages/lib-js-core/docs/basics/logger.md @@ -8,7 +8,7 @@ With `logger` method you're able to: # Import ```js -const {logger} = Server(ctx) +const {logger} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/responses.md b/packages/lib-js-core/docs/basics/responses.md index 2ec5917b..174f0c13 100644 --- a/packages/lib-js-core/docs/basics/responses.md +++ b/packages/lib-js-core/docs/basics/responses.md @@ -8,7 +8,7 @@ With `response` method you're able to: # Import ```js -const {response} = Server(ctx) +const {response} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/docs/basics/users.md b/packages/lib-js-core/docs/basics/users.md index 9b27b9aa..fdf3b6ed 100644 --- a/packages/lib-js-core/docs/basics/users.md +++ b/packages/lib-js-core/docs/basics/users.md @@ -8,7 +8,7 @@ With `users` you're able to: # Import ```js -const {users} = Server(ctx) +const {users} = new Server(ctx) ``` # Methods diff --git a/packages/lib-js-core/src/data.js b/packages/lib-js-core/src/data.js index 6bbc88e9..3e2aa8a8 100644 --- a/packages/lib-js-core/src/data.js +++ b/packages/lib-js-core/src/data.js @@ -149,11 +149,6 @@ class Data extends QueryBuilder { return processedResult } - // saveToResult (response) { - // // return = this.result.concat(response.objects) - // return = response.objects) - // } - resolveIfFinished (result) { if (this.query.page_size !== 0) { return result.slice(0, this.query.page_size) @@ -217,9 +212,6 @@ class Data extends QueryBuilder { const fetches = urls.map(async url => self.request(url)) - // results = await self._replaceCustomTypesWithValue(results) - // results = await self._mapFields(results) - let results = await Promise.all(fetches) results = [].concat.apply([], results) results = await self.resolveRelatedModels(results) diff --git a/packages/lib-js-core/test/e2e/data.js b/packages/lib-js-core/test/e2e/data.js index f4f391b3..9df99916 100644 --- a/packages/lib-js-core/test/e2e/data.js +++ b/packages/lib-js-core/test/e2e/data.js @@ -306,7 +306,7 @@ describe('Data', function () { .take(3) .pluck('field_string') .should.become(['example-string1', 'example-string2', 'example-string3']) - }) // eslint-disable-line camelcase + }) }) describe('#value()', () => { @@ -339,7 +339,7 @@ describe('Data', function () { run() .where([ - ['field_string', '=', 'example-string'], // eslint-disable-line camelcase + ['field_string', '=', 'example-string'], ['field_integer', '>=', 100] ]) .list()