Skip to content

Commit

Permalink
Merge pull request #961 from opencb/TASK-6636
Browse files Browse the repository at this point in the history
TASK-6636 - Job Kill method in JavaScript client of OpenCGA sends the params as POST body data
  • Loading branch information
juanfeSanahuja authored Aug 13, 2024
2 parents 74d0595 + 87f3efc commit 17148ba
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/core/clients/opencga/api/ClinicalAnalysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ export default class ClinicalAnalysis extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
clearInterpretation(clinicalAnalysis, interpretations, params) {
return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "clear", params);
return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "clear", null, params);
}

/** Delete interpretation
Expand All @@ -859,7 +859,7 @@ export default class ClinicalAnalysis extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
revertInterpretation(clinicalAnalysis, interpretation, version, params) {
return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "revert", {version, ...params});
return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "revert", null, {version, ...params});
}

/** Update interpretation fields
Expand Down
2 changes: 1 addition & 1 deletion src/core/clients/opencga/api/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default class File extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
upload(params) {
return this._post("files", null, null, null, "upload", params);
return this._post("files", null, null, null, "upload", null, params);
}

/** Return the acl defined for the file or folder. If member is provided, it will only return the acl for the member.
Expand Down
4 changes: 2 additions & 2 deletions src/core/clients/opencga/api/GA4GH.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class GA4GH extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
searchReads() {
return this._post("ga4gh", null, "reads", null, "search");
return this._post("ga4gh", null, "reads", null, "search", null);
}

/** Fetch alignment files using HTSget protocol
Expand Down Expand Up @@ -78,7 +78,7 @@ export default class GA4GH extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
searchVariants() {
return this._post("ga4gh", null, "variants", null, "search");
return this._post("ga4gh", null, "variants", null, "search", null);
}

}
2 changes: 1 addition & 1 deletion src/core/clients/opencga/api/Job.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default class Job extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
kill(job, params) {
return this._post("jobs", job, null, null, "kill", params);
return this._post("jobs", job, null, null, "kill", null, params);
}

/** Show the first lines of a log file (up to a limit)
Expand Down
2 changes: 2 additions & 0 deletions src/core/clients/opencga/api/Organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export default class Organization extends OpenCGAParentClass {
* @param {Object} [params] - The Object containing the following optional parameters:
* @param {String} [params.include] - Fields included in the response, whole JSON path must be provided.
* @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided.
* @param {"ADD SET REMOVE"} [params.tagsAction = "ADD"] - Action to be performed if the array of tags is being updated. The default
* value is ADD.
* @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response.
* The default value is false.
* @returns {Promise} Promise object in the form of RestResponse instance.
Expand Down
2 changes: 1 addition & 1 deletion src/core/clients/opencga/api/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Project extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
incRelease(project) {
return this._post("projects", project, null, null, "incRelease");
return this._post("projects", project, null, null, "incRelease", null);
}

/** Fetch all the studies contained in the project
Expand Down
4 changes: 3 additions & 1 deletion src/core/clients/opencga/api/Study.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ export default class Study extends OpenCGAParentClass {
* @param {Object} [params] - The Object containing the following optional parameters:
* @param {String} [params.include] - Fields included in the response, whole JSON path must be provided.
* @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided.
* @param {"ADD SET REMOVE"} [params.tagsAction = "ADD"] - Action to be performed if the array of tags is being updated. The default
* value is ADD.
* @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response.
* The default value is false.
* @returns {Promise} Promise object in the form of RestResponse instance.
Expand Down Expand Up @@ -279,7 +281,7 @@ export default class Study extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
uploadTemplates(study, params) {
return this._post("studies", study, "templates", null, "upload", params);
return this._post("studies", study, "templates", null, "upload", null, params);
}

/** Delete template
Expand Down
2 changes: 1 addition & 1 deletion src/core/clients/opencga/api/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class User extends OpenCGAParentClass {
* @returns {Promise} Promise object in the form of RestResponse instance.
*/
anonymous(organization) {
return this._post("users", null, null, null, "anonymous", organization);
return this._post("users", null, null, null, "anonymous", null, organization);
}

/** Create a new user
Expand Down
7 changes: 0 additions & 7 deletions src/core/clients/opencga/opencga-parent-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ export default class OpenCGAParentClass {
}

_post(category1, ids1, category2, ids2, action, body, params = {}, options = {}) {
// Clear and Revert actions do not need a body, but needs a params
if (category2 === "interpretation" && (action === "clear" || action === "revert")) {
// eslint-disable-next-line no-param-reassign
params = body;
// eslint-disable-next-line no-param-reassign
body = {};
}
const host = this._config.host;
const version = this._config.version;
// const rpc = this._config.mode;
Expand Down

0 comments on commit 17148ba

Please sign in to comment.