Skip to content

Commit

Permalink
Remove max days to keep limit in devicestatus delete.
Browse files Browse the repository at this point in the history
Remove unused count query option in devicestatus delete api.
  • Loading branch information
Jeremy Cunningham committed Aug 25, 2018
1 parent fdc5ed3 commit 3101a8d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
4 changes: 2 additions & 2 deletions lib/admin_plugins/cleanstatusdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ cleanstatusdb.actions[1].init = function init(client, callback) {
var numDays = '<br/>'
+ '<label for="admin_devicestatus_days">'
+ translate('Number of Days to Keep:')
+ ' <input id="admin_devicestatus_days" value="30" size="3" min="1" max="365"/>'
+ ' <input id="admin_devicestatus_days" value="30" size="3" min="1"/>'
+ '</label>';

$('#admin_' + cleanstatusdb.name + '_1_html').html(numDays);
Expand All @@ -98,7 +98,7 @@ cleanstatusdb.actions[1].code = function deleteOldRecords(client, callback) {
var $status = $('#admin_' + cleanstatusdb.name + '_1_status');
var numDays = Number($('#admin_devicestatus_days').val());

if (isNaN(numDays) || (numDays <= 0)) {
if (isNaN(numDays) || (numDays < 1)) {
alert(translate('%1 is not a valid number', { params: [$('#admin_devicestatus_days').val()] }));
if (callback) { callback(); }
return;
Expand Down
3 changes: 0 additions & 3 deletions lib/api/devicestatus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ function configure (app, wares, ctx) {
// delete record that match query
api.delete('/devicestatus/', ctx.authorization.isPermitted('api:devicestatus:delete'), function(req, res) {
var query = req.query;
if (!query.count) {
query.count = 10
}

console.log('Delete records with query: ', query);

Expand Down
9 changes: 0 additions & 9 deletions swagger.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -730,15 +730,6 @@
"schema": {
"type": "string"
}
},
{
"name": "count",
"in": "query",
"description": "Number of records to return.",
"required": false,
"schema": {
"type": "number"
}
}
],
"tags": [
Expand Down
6 changes: 0 additions & 6 deletions swagger.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,6 @@ paths:
required: false
schema:
type: string
- name: count
in: query
description: Number of records to return.
required: false
schema:
type: number
tags:
- Devicestatus
responses:
Expand Down

0 comments on commit 3101a8d

Please sign in to comment.