Skip to content

Commit

Permalink
Update GetJobs.ts
Browse files Browse the repository at this point in the history
encoding.trim() only works if encoding is interpreted as a string, but it might just be a number.

Signed-off-by: COBOL-Erik <[email protected]>
  • Loading branch information
COBOL-Erik authored Dec 17, 2024
1 parent a0b45a0 commit fb688ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/zosjobs/src/GetJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ export class GetJobs {
ImperativeExpect.toNotBeNullOrUndefined(spoolId, "Required parameter spoolId must be defined");
let parameters: string = "/" + encodeURIComponent(jobname) + "/" + encodeURIComponent(jobid) +
JobsConstants.RESOURCE_SPOOL_FILES + "/" + encodeURIComponent(spoolId) + JobsConstants.RESOURCE_SPOOL_CONTENT;
if (encoding && encoding.trim() != "") {parameters += "?fileEncoding=" + encoding;}
if (encoding) {
encoding = String(encoding);
if(encoding.trim() != "") {parameters += "?fileEncoding=" + encoding;}
}
Logger.getAppLogger().info("GetJobs.getSpoolContentById() parameters: " + parameters);
return ZosmfRestClient.getExpectString(session, JobsConstants.RESOURCE + parameters, [Headers.TEXT_PLAIN_UTF8]);
}
Expand Down

0 comments on commit fb688ae

Please sign in to comment.