Skip to content

Commit 811ea79

Browse files
authored
Merge pull request #229 from strongloop/fix-remoting-method
Update deprecated remoting metadata functions
2 parents 6e2b948 + 97c2630 commit 811ea79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/services.template.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' &&
7373
'LoopBackResource', 'LoopBackAuth', '$injector',
7474
function(Resource, LoopBackAuth, $injector) {
7575
var R = Resource(
76-
urlBase + <%-: meta.ctor.getFullPath() | q %>,
76+
urlBase + <%-: meta.ctor.getEndpoints()[0].fullPath | q %>,
7777
<% /*
7878
Constructor arguments are hardcoded for now.
7979
We should generate it from sharedCtor.accepts instead.
@@ -123,8 +123,8 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' &&
123123
<% }); //action.params.foreach -%>
124124
},
125125
<% } -%>
126-
url: urlBase + <%-: action.getFullPath() | q %>,
127-
method: <%-: action.getHttpMethod() | q %>,
126+
url: urlBase + <%-: action.getEndpoints()[0].fullPath | q %>,
127+
method: <%-: action.getEndpoints()[0].verb | q %>,
128128
},
129129
<% }); // meta.methods.foreach -%>
130130
<% if (meta.isUser) { -%>
@@ -529,7 +529,7 @@ action.description = '<em>\n' +
529529
<%
530530
var params = action.accepts;
531531
var postData;
532-
if (action.getHttpMethod() == 'POST' || action.getHttpMethod() == 'PUT') {
532+
if (action.getEndpoints()[0].verb == 'POST' || action.getEndpoints()[0].verb == 'PUT') {
533533
params = params.filter(function(arg) {
534534
return arg.http && (arg.http.source == 'query' || arg.http.source == 'path');
535535
});

0 commit comments

Comments
 (0)