Skip to content

Commit

Permalink
parse status query param to int (uber#544)
Browse files Browse the repository at this point in the history
Co-authored-by: Assem Hafez <assem.a.hafez@gmail.com>
  • Loading branch information
Assem-Uber and Assem-Hafez committed Mar 26, 2024
1 parent dfeddb3 commit 6a2e403
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/router/routes/workflow-archived-list-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ const workflowArchivedListHandler = async ctx => {
} else {
const startTime = moment(query.startTime || NaN);
const endTime = moment(query.endTime || NaN);
const parsedStatus =
query.status && !isNaN(query.status)
? parseInt(query.status)
: query.status;

ctx.assert(startTime.isValid() && endTime.isValid(), 400);
queryString = buildQueryString(startTime, endTime, query);
queryString = buildQueryString(startTime, endTime, {
...query,
status: parsedStatus,
});
}

const archivedWorkflowsResponse = await ctx.cadence.archivedWorkflows({
Expand Down

0 comments on commit 6a2e403

Please sign in to comment.