Skip to content
Snippets Groups Projects
Commit 9ced7ecd authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Modified front-end a bit to take in a JSON-formatted string that the new

REST API gives out and parse that into the CapabilityRequest object
parent 6a6fd3df
No related branches found
No related tags found
1 merge request!95Modified front-end to play nicely with the capability request REST API changes
Pipeline #616 passed
......@@ -21,12 +21,16 @@ export class CapabilityLauncherService {
createRequest(
capabilityName: string,
parameters: string
): Observable<CapabilityRequest> {
const url = environment.workspacesUrl + this.endpoint + capabilityName + "/request/create";
): Observable<string> {
const url =
environment.workspacesUrl +
this.endpoint +
capabilityName +
"/request/create";
const requestParams = JSON.stringify({
parameters: parameters,
});
return this.httpClient.post<CapabilityRequest>(url, requestParams);
return this.httpClient.post<string>(url, requestParams);
}
/**
......
......@@ -42,12 +42,12 @@ export class WorkspacesComponent implements OnInit {
// Create capability request
this.capabilityLauncher.createRequest(capabilityName, parameters).subscribe(
(requestResponse) => {
this.capabilityRequests.push(requestResponse);
if (requestResponse.id) {
const capabilityRequest = JSON.parse(requestResponse);
this.capabilityRequests.push(capabilityRequest);
if (capabilityRequest.id) {
// Capability request created; ID found
const requestId = requestResponse.id;
// Submit capability request
this.capabilityLauncher.submit(requestId).subscribe(
this.capabilityLauncher.submit(capabilityRequest.id).subscribe(
(submitResponse) => {
this.capabilityExecutions.push(submitResponse);
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment