Skip to content

Commit b695ac1

Browse files
committed
Change State id to int
1 parent 61ed642 commit b695ac1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/wrapper/CxWrapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ export class CxWrapper {
200200
return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.PREDICATE_TYPE);
201201
}
202202

203-
async triageUpdate(projectId: string, similarityId: string, scanType: string, state: string, comment: string, severity: string, stateId = -1): Promise<CxCommandOutput> {
203+
async triageUpdate(projectId: string, similarityId: string, scanType: string, state: string, comment: string, severity: string, stateId:number|null = null): Promise<CxCommandOutput> {
204204
const commands: string[] = [CxConstants.CMD_TRIAGE, CxConstants.SUB_CMD_UPDATE, CxConstants.PROJECT_ID, projectId, CxConstants.SIMILARITY_ID, similarityId, CxConstants.SCAN_TYPES_SUB_CMD, scanType, CxConstants.STATE, state, CxConstants.COMMENT, comment, CxConstants.SEVERITY, severity];
205-
if(stateId!==-1) {
205+
if(stateId) {
206206
commands.push(CxConstants.STATE_ID)
207207
commands.push(stateId.toString())
208208
}

src/tests/PredicateTest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("Triage cases", () => {
3131
expect(cxShow.exitCode).toEqual(0);
3232
}
3333

34-
const handleTriageUpdate = async (scan: any, result: CxResult, newState: string, newSeverity: string, newStateId = -1) => {
34+
const handleTriageUpdate = async (scan: any, result: CxResult, newState: string, newSeverity: string, newStateId: number|null = null ) => {
3535
const cxUpdate: CxCommandOutput = await auth.triageUpdate(
3636
scan.projectID, result.similarityId, result.type, newState,
3737
"Edited via JavascriptWrapper",

0 commit comments

Comments
 (0)