Skip to content

Angular bulk upsert throwing error #2229

Description

@jonathanwoahn

First off, I just learned about Loopback about 2 weeks ago, and it has changed my life. I love it.

Second, I'm getting an error in Angular using the lbService while doing a bulk upsert:

angular.js:11607 Error: [$resource:badcfg] Error in resource configuration for action`upsert`. Expected response to contain an object but got an array
http://errors.angularjs.org/1.3.12/$resource/badcfg?p0=upsert&p1=object&p2=array

I have located the problem, in the "upsert" method in lbService for the Angular resource. When doing a bulk upsert, there is a parameter that needs to be set that current doesn't exist:

"upsert": {
          url: urlBase + "/TaskSessions",
          method: "PUT",
          isArray: true //<--- this does not currently exist
        },

I have been able to get around this issue for my application, but it needs to be fixed in the Loopback Angular SDK generator for a more permanent solution. Just thought you'd want to know

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions