Skip to content

Commit

Permalink
parse status query param to int (#544)
Browse files Browse the repository at this point in the history
Co-authored-by: Assem Hafez <[email protected]>
  • Loading branch information
Assem-Uber and Assem-Hafez authored Mar 26, 2024
1 parent 0f96962 commit 9bc4e2f
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 9bc4e2f

Please sign in to comment.