Skip to content

Commit

Permalink
Merge pull request #45 from feathersjs/array-create--prevent-hook-ite…
Browse files Browse the repository at this point in the history
…ration

Remove array check in create.
  • Loading branch information
marshallswain committed Jan 30, 2016
2 parents 2ff9f4b + 50a831c commit c2ce775
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Service {
// $select uses a specific find syntax, so it has to come first.
if (filters.$select && filters.$select.length) {
let fields = {};

for (let key of filters.$select) {
fields[key] = 1;
}
Expand Down Expand Up @@ -100,11 +100,7 @@ class Service {
}).catch(errorHandler);
}

create(data, params) {
if(Array.isArray(data)) {
return Promise.all(data.map(current => this.create(current, params)));
}

create(data) {
return this.Model.create(data).catch(errorHandler);
}

Expand Down Expand Up @@ -195,4 +191,4 @@ export default function init(options) {
return new Service(options);
}

init.Service = Service;
init.Service = Service;

0 comments on commit c2ce775

Please sign in to comment.