Skip to content

Commit f83f80b

Browse files
committed
fix(lib): Fix incorrect call for post / put from 7.3.0
Bug introducted in last versions, when changing call from request to specific call method. But body must be given in an other parameters.
1 parent f8ef679 commit f83f80b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

projects/ngx-http-annotations/src/lib/ngx-http-annotations.utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,22 @@ export class HttpRestUtils {
181181
}
182182

183183
private static getRequest(callConfig: CallConfig) {
184+
const {body: any, ...params} = callConfig.params;
184185
switch (callConfig.requestMethodName) {
185186
case RequestMethodParams.get:
186187
return HttpRestUtils.http.get(callConfig.url, callConfig.params);
187188
case RequestMethodParams.post:
188-
return HttpRestUtils.http.post(callConfig.url, callConfig.params);
189+
return HttpRestUtils.http.post(callConfig.url, body, params);
189190
case RequestMethodParams.put:
190-
return HttpRestUtils.http.put(callConfig.url, callConfig.params);
191+
return HttpRestUtils.http.put(callConfig.url, body, params);
191192
case RequestMethodParams.delete:
192193
return HttpRestUtils.http.delete(callConfig.url, callConfig.params);
193194
case RequestMethodParams.options:
194195
return HttpRestUtils.http.options(callConfig.url, callConfig.params);
195196
case RequestMethodParams.head:
196197
return HttpRestUtils.http.head(callConfig.url, callConfig.params);
197198
case RequestMethodParams.patch:
198-
return HttpRestUtils.http.patch(callConfig.url, callConfig.params);
199+
return HttpRestUtils.http.patch(callConfig.url, body, params);
199200
default:
200201
return HttpRestUtils.http.request(callConfig.requestMethodName, callConfig.url, callConfig.params);
201202
}

0 commit comments

Comments
 (0)