Fixed camera_id photo search parameter

This commit is contained in:
Michael Mayer 2018-09-13 11:51:40 +02:00
parent 37912b4b99
commit d63e486499

View file

@ -191,7 +191,7 @@
const resultPage = query.hasOwnProperty('page') ? parseInt(query['page']) : 1; const resultPage = query.hasOwnProperty('page') ? parseInt(query['page']) : 1;
const resultOffset = resultCount * (resultPage - 1); const resultOffset = resultCount * (resultPage - 1);
const order = query.hasOwnProperty('order') && query['order'] != "" ? query['order'] : 'taken_at DESC'; const order = query.hasOwnProperty('order') && query['order'] != "" ? query['order'] : 'taken_at DESC';
const dir = query.hasOwnProperty('dir') ? query['dir'] : ''; const camera_id = query.hasOwnProperty('camera_id') ? parseInt(query['camera_id']) : '';
const q = query.hasOwnProperty('q') ? query['q'] : ''; const q = query.hasOwnProperty('q') ? query['q'] : '';
const view = query.hasOwnProperty('view') ? query['view'] : 'tile'; const view = query.hasOwnProperty('view') ? query['view'] : 'tile';
const cameras = [{value: '', text: 'All Cameras'}]; const cameras = [{value: '', text: 'All Cameras'}];
@ -209,7 +209,7 @@
'query': { 'query': {
category: '', category: '',
country: '', country: '',
camera_id: '', camera_id: camera_id,
order: order, order: order,
q: q, q: q,
}, },
@ -234,8 +234,6 @@
], ],
}, },
'page': resultPage, 'page': resultPage,
'order': order,
'dir': dir,
'view': view, 'view': view,
'resultCount': resultCount, 'resultCount': resultCount,
'resultOffset': resultOffset, 'resultOffset': resultOffset,