Skip to content

Commit

Permalink
fix: make api version dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
btrn11 committed Jan 22, 2025
1 parent 08d5fbb commit 4c532ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/package/packagePushUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class PackagePushUpgrade {

const pushRequestResult: PackagePushRequestResult = await connection.request({
method: 'POST',
url: '/services/data/v62.0/sobjects/packagepushrequest/',
url: `/services/data/v${connection.getApiVersion()}/sobjects/packagepushrequest/`,
body: JSON.stringify(packagePushRequestBody),
});

Expand All @@ -170,7 +170,7 @@ export class PackagePushUpgrade {

await connection.request({
method: 'PATCH',
url: '/services/data/v62.0/sobjects/packagepushrequest/' + pushRequestResult?.id,
url: `/services/data/v${connection.getApiVersion()}/sobjects/packagepushrequest/` + pushRequestResult?.id,
body: JSON.stringify({ Status: 'Pending' }),
});

Expand Down Expand Up @@ -206,9 +206,9 @@ export class PackagePushUpgrade {
.join('');

await fs.writeFile(outputFile, errorContent, 'utf-8');
throw new Error(`Push upgrade failed. Job errors have been written to file: ${outputFile}`);
throw new Error(`Push upgrade failed, job errors have been written to file: ${outputFile}`);
} catch (error) {
throw new Error('Error when saving job errors to file' + (error as Error).message);
throw new Error('Error when saving job errors to file. ' + (error as Error).message);
}
}
}
Expand Down

0 comments on commit 4c532ee

Please sign in to comment.