Skip to content

Commit

Permalink
Merge pull request #90 from mountaindude/master
Browse files Browse the repository at this point in the history
v4.1.1 RC1
  • Loading branch information
mountaindude authored Oct 28, 2020
2 parents cd20d25 + 4059ec7 commit 74cb159
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/rest/senseStartTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const errors = require('restify-errors');
/**
* @swagger
*
* /v4/sensestarttask:
* /v4/reloadtask/{taskId}/start:
* put:
* description: |
* Start a Qlik Sense task
Expand All @@ -16,10 +16,10 @@ const errors = require('restify-errors');
* parameters:
* - name: taskId
* description: ID of Qlik Sense task
* in: body
* in: path
* required: true
* type: string
* example: "{taskId: 210832b5-6174-4572-bd19-3e61eda675ef}"
* example: "210832b5-6174-4572-bd19-3e61eda675ef"
* responses:
* 201:
* description: Task successfully started.
Expand All @@ -28,7 +28,8 @@ const errors = require('restify-errors');
* properties:
* taskId:
* type: string
* 409:
* description: Task ID of started task.
* 409:
* description: Required parameter missing.
* 500:
* description: Internal error.
Expand All @@ -39,19 +40,19 @@ module.exports.respondPUT_senseStartTask = function (req, res, next) {
// TODO: Add task exists test. Return error if not.

try {
if (req.body.taskId == undefined) {
if (req.params.taskId == undefined) {
// Required parameter is missing
res.send(new errors.MissingParameterError({}, 'Required parameter missing'));
} else {
// Use data in request to start Qlik Sense task
globals.logger.verbose(`STARTTASK: Starting task: ${req.body.taskId}`);
globals.logger.verbose(`STARTTASK: Starting task: ${req.params.taskId}`);

globals.qrsUtil.senseStartTask.senseStartTask(req.body.taskId);
res.send(201, req.body);
globals.qrsUtil.senseStartTask.senseStartTask(req.params.taskId);
res.send(201, {'taskId': req.params.taskId});
next();
}
} catch (err) {
globals.logger.error(`STARTTASK: Failed starting task: ${req.body.taskId}`);
globals.logger.error(`STARTTASK: Failed starting task: ${req.params.taskId}`);
res.send(new errors.InternalError({}, 'Failed starting task'));
next();
}
Expand Down

0 comments on commit 74cb159

Please sign in to comment.