Update approveChange and createPrdUpdate

This commit is contained in:
Sosthene 2024-12-17 23:59:13 +01:00
parent f400139052
commit aff12a4007

View File

@ -221,13 +221,9 @@ export default class Services {
}
// Create prd update for current process and update
public createPrdUpdate(pcdMerkleRoot: string): ApiReturn {
if (!this.currentProcess) {
throw new Error('No current process defined');
}
public createPrdUpdate(processId: string, stateId: string): ApiReturn {
try {
return this.sdkClient.create_update_message(this.currentProcess, pcdMerkleRoot);
return this.sdkClient.create_update_message(processId, stateId);
} catch (e) {
throw new Error(`Failed to create prd update: ${e}`);
}
@ -245,13 +241,9 @@ export default class Services {
}
}
public approveChange(currentPcdMerkleRoot: string): ApiReturn {
if (!this.currentProcess) {
throw new Error('No current process defined');
}
public approveChange(processId: string, stateId: string): ApiReturn {
try {
return this.sdkClient.validate_state(this.currentProcess, currentPcdMerkleRoot);
return this.sdkClient.validate_state(processId, stateId);
} catch (e) {
throw new Error(`Failed to create prd response: ${e}`);
}