How to disable PATCH methods?

475 views
Skip to first unread message

Hristo Vrigazov

unread,
Aug 7, 2016, 9:05:07 AM8/7/16
to LoopbackJS
Hello,

I am developing a Loopback application with Cloud9 as IDE and there I have no PATCH methods, however when I deploy the application to Heroku, some PATCH methods show up both as static and as instance methods. How would I disable them? I guess this should be done by calling:

Model.disableRemoteMethod('method name', isStatic);

But what is the name of this method? I could not find in Loopback docs.

Thanks,
Hristo

Eric Alves da Rocha

unread,
Aug 9, 2016, 3:05:49 PM8/9/16
to loopb...@googlegroups.com
Hi...

Model.disableRemoteMethod('create', isStatic);
Model.disableRemoteMethod('delete', isStatic);
Model.disableRemoteMethod('__create__' + relatioName, isStatic); // remote methods to relations models;


Att.,
Eric A. da Rocha

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/6458e195-1c3a-49a7-be7b-4ced8954749a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rémi Flipo

unread,
Aug 16, 2016, 7:48:25 AM8/16/16
to LoopbackJS
Hi,

you can also use a mixin in order not to repeat yourself :

Amir Ali

unread,
Oct 5, 2016, 9:17:57 AM10/5/16
to LoopbackJS
 
Is the problem solved? Are you using LB.2x? in LB.2x the following endpoints are exposed using PATCH verb:

patchOrCreate(data:object)PATCH /customers
prototype.patchAttributes(data:object)PATCH /customers/:id
 
Reply all
Reply to author
Forward
0 new messages