Skip to content

Commit

Permalink
fix: fix wrong expanded URL in request dialog when URI is templated
Browse files Browse the repository at this point in the history
  • Loading branch information
toedter committed Apr 11, 2021
1 parent 3963acc commit 8c0a76d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/request/request.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class RequestComponent implements OnInit {
this.selectedHttpMethod = event.command;
this.templatedUri = undefined;
this.isUriTemplate = this.isUriTemplated(event.uri);
this.originalRequestUri = event.uri;
if (this.isUriTemplate) {
const uriTemplate: URITemplate = utpl(event.uri);
this.uriTemplateParameters = [];
Expand All @@ -120,7 +121,6 @@ export class RequestComponent implements OnInit {
this.templatedUri = event.uri;
this.computeUriFromTemplate();
} else {
this.originalRequestUri = event.uri;
this.newRequestUri = event.uri;
}

Expand Down Expand Up @@ -177,7 +177,10 @@ export class RequestComponent implements OnInit {

propertyChanged() {
this.requestBody = '{\n';
if (this.originalRequestUri) {

if (this.templatedUri) {
this.computeUriFromTemplate(false);
} else if (this.originalRequestUri) {
this.newRequestUri = this.originalRequestUri;
}
let hasQueryParams = false;
Expand All @@ -194,7 +197,6 @@ export class RequestComponent implements OnInit {
}
} else if (this.halFormsProperties) {
if (this.templatedUri) {
this.computeUriFromTemplate(false);
hasQueryParams = this.newRequestUri.includes('?');
}
for (const item of this.halFormsProperties) {
Expand Down

0 comments on commit 8c0a76d

Please sign in to comment.