fix(striker-ui-api): rename /job query param to "start"

main
Tsu-ba-me 2 years ago
parent 3d6f051a7d
commit 25f1e1e206
  1. 6
      striker-ui-api/src/lib/request_handlers/job/getJob.ts

@ -3,14 +3,14 @@ import { sanitizeQS } from '../../sanitizeQS';
import { date } from '../../shell'; import { date } from '../../shell';
export const getJob = buildGetRequestHandler((request, buildQueryOptions) => { export const getJob = buildGetRequestHandler((request, buildQueryOptions) => {
const { epoch } = request.query; const { start: rawStart } = request.query;
const sanitizedEpoch = sanitizeQS(epoch, { returnType: 'number' }); const start = sanitizeQS(rawStart, { returnType: 'number' });
let condModifiedDate = ''; let condModifiedDate = '';
try { try {
const minDate = date('--date', `@${sanitizedEpoch}`, '--rfc-3339', 'ns'); const minDate = date('--date', `@${start}`, '--rfc-3339', 'ns');
condModifiedDate = `OR (job.job_progress = 100 AND job.modified_date >= '${minDate}')`; condModifiedDate = `OR (job.job_progress = 100 AND job.modified_date >= '${minDate}')`;
} catch (shellError) { } catch (shellError) {

Loading…
Cancel
Save