Skip to content

Instantly share code, notes, and snippets.

@nagornyi
Created May 27, 2022 07:07
// Add a new run to the project
async addRun(projectId, entryJSON) {
var url = `${this.base_url}/api/v2/add_run/${projectId}`;
var res = await request.post(url, {
headers: this.headers,
json: entryJSON
});
if (res.statusCode >= 300) console.error(res.body);
var run = JSON.parse(res.body);
return run;
}
// Update an existing run
async updateRun(runId, entryJSON) {
var url = `${this.base_url}/api/v2/update_run/${runId}`;
var res = await request.post(url, {
headers: this.headers,
json: entryJSON
});
if (res.statusCode >= 300) console.error(res.body);
var run = JSON.parse(res.body);
return run;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment