Expose Replace* methods for 2.x - #2435
Conversation
I don't see why it would be a bad thing to expose API docs for the two new methods, what am I missing? |
| // This is just for LB 2.x | ||
| options.replaceOnPUT = options.replaceOnPUT === true; | ||
|
|
||
| function setRemoting(scope, name, options) { |
There was a problem hiding this comment.
I think this should be set to false by default, shouldn't it?
There was a problem hiding this comment.
I believe options.replaceOnPUT = options.replaceOnPUT === true; by default sets to false, isn't it? Lets see:
If options.replaceOnPUT is undefined undefined === true => false
If options.replaceOnPUT is false false === true => false
If options.replaceOnPUT is true true === true => true
Am I missing something?
There was a problem hiding this comment.
Oh sorry, this is my fault, I overlooked === and thought it's =.
|
LGTM |
|
@bajtos Lets please not merge this PR for now. I had a talk with @qpresley and we decided to have a discussion in F2F meeting about other IBM connectors (cloudant, informix. dashDB, DB2, DB2z, mqlight,...) support for replace methods before landing this PR. Mentioned connectors need to be tested as well; they are not on CI. Thanks! |
Replace* methods for 2.xReplace* methods for 2.x
Replace* methods for 2.xReplace* methods for 2.x
0dd7d54 to
1bf08db
Compare
|
@laven26 @ssh24, So I'm about to land this PR which exposes our Thanks! |
|
mssql, mysql, oracl, mongodb and postgres all work as expected |
|
DB2, DashDB and Cloudant all work as expected |
*Re-mapping `updateAttributes` endpoint to use `PATCH` and `PUT`(configurable) verb *Exposing `replaceById` and `replaceOrCreate` via `POST` and `PUT`(configurable) verb
1bf08db to
e562137
Compare
Replace* methods for 2.xReplace* methods for 2.x
Patch description:
*Re-mapping
updateAttributesendpoint to usePATCHandPUT(configurable) verb*Exposing
replaceByIdandreplaceOrCreateviaPOSTandPUT(configurable) verbWhat are the differences between this ptach for
2.xVs. patch for3.x:Default value for
replaceOnPUTwould be set to false; please see hereIn this patch for
2.x, we preserveupsertand setpachOrCreateas an alias only and change tests accordingly.In this patch for
2.x, we preserveupdateAttributesand setpachAttributesas an alias only and change tests accordingly.Question: JSdoc for
PersistedModel Methodsare generated based onlib\persisted-models.js, so once this patch gets landed I believe docs for replaceOrCreate, replaceAttributes and replaceById gets added to our API docs, are we fine with that now?PS: I squash my commits as one single commit after getting an LGTM. Thanks!
Connect to https://github.com/strongloop-internal/scrum-loopback/issues/917
/to: @bajtos