Skip to content

Commit

Permalink
fix(comms): extend FileSpray.DFUWUFile to change reponse type to not …
Browse files Browse the repository at this point in the history
…be JSON

consistent with WsWorkunits.WUFile

Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Oct 19, 2023
1 parent a01e326 commit 769b1cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/comms/src/ecl/dfuWorkunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class DFUWorkunit extends StateObject<UDFUWorkunitState, IDFUWorkunitStat
return this;
}

fetchXML(callback?: void): Promise<FileSpray.DFUWUFileResponse> {
fetchXML(callback?: void): Promise<string> {
return this.DFUWUFile();
}

Expand All @@ -239,14 +239,14 @@ export class DFUWorkunit extends StateObject<UDFUWorkunitState, IDFUWorkunitStat
return retVal;
}

protected DFUWUFile(_request: Partial<FileSpray.DFUWUFileRequest> = {}): Promise<FileSpray.DFUWUFileResponse> {
return this.connection.DFUWUFile({
protected DFUWUFile(_request: Partial<FileSpray.DFUWUFileRequest> = {}): Promise<string> {
return this.connection.DFUWUFileEx({
..._request, Wuid: this.ID
}).then(response => {
//TODO: additional processing?
return response;
}).catch((e: ESPExceptions) => {
return {} as FileSpray.DFUWUFileResponse;
return "";
});
}

Expand Down
4 changes: 4 additions & 0 deletions packages/comms/src/services/fileSpray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export interface UpdateDFUWorkunitEx extends UpdateDFUWorkunitMinusWU {

export class FileSprayService extends FileSprayServiceBase {

DFUWUFileEx(request: FileSpray.DFUWUFileRequest): Promise<string> {
return this._connection.send("DFUWUFile", request, "text");
}

SprayFixedEx(request: Partial<FileSpray.SprayFixed>): Promise<FileSpray.SprayFixedResponse> {
return this._connection.send("SprayFixed", request);
}
Expand Down

0 comments on commit 769b1cb

Please sign in to comment.