Skip to content

Commit

Permalink
Added path params to entry options
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremythuff committed May 28, 2021
1 parent 64f2026 commit b57eda0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ export class ManifestEffects {
return ManifestActions.queueRequest({ request });
}

let path = entry.path;
request.options.pathVariables.forEach((v, k) => {
path = path.split(k)
.join(v);
});

const method = request.method ? request.method : entry.methods[0];
// TODO: validate method with allowed methods on manifests entry
const url = manifest.baseUrl + entry.path;
const url = manifest.baseUrl + path;
const options = { ...entry.options, ...request.options };
const onSuccess = request.onSuccess ? request.onSuccess : [];
const onFailure = request.onFailure ? request.onFailure : [];
Expand Down
1 change: 1 addition & 0 deletions projects/wvr-elements/src/lib/core/rest/request-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface RequestOptions {
headers?: { [header: string]: string | Array<string>; };
observe?: 'body' | 'response' | 'events';
params?: HttpParams | { [param: string]: string | Array<string>; };
pathVariables?: Map<string, string>;
reportProgress?: boolean;
responseType?: 'arraybuffer' | 'blob' | 'text' | 'json';
withCredentials?: boolean;
Expand Down

0 comments on commit b57eda0

Please sign in to comment.