Skip to content

Commit

Permalink
Improved: removed unnecessary checks from the fetchCycleCounts actions (
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed Jan 21, 2025
1 parent c0ef022 commit 84989f7
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions src/store/modules/count/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,22 @@ const actions: ActionTree<CountState, RootState> = {
params["orderByField"] = state.query.sortBy
}

if(state.query.createdDate) {
// created before date
if(state.query.createdDate?.thru) {
params["createdDate_thru"] = convertIsoToMillis(state.query.createdDate.thru)
}
// created after date
if(state.query.createdDate?.from) {
params["createdDate_from"] = convertIsoToMillis(state.query.createdDate.from)
}
// created before date
if(state.query.createdDate?.thru) {
params["createdDate_thru"] = convertIsoToMillis(state.query.createdDate.thru)
}
// created after date
if(state.query.createdDate?.from) {
params["createdDate_from"] = convertIsoToMillis(state.query.createdDate.from)
}

if(state.query.closedDate) {
// closed before date
if(state.query.closedDate?.thru) {
params["closedDate_thru"] = convertIsoToMillis(state.query.closedDate.thru)
}
// closed after date
if(state.query.closedDate?.from) {
params["closedDate_from"] = convertIsoToMillis(state.query.closedDate.from)
}
// closed before date
if(state.query.closedDate?.thru) {
params["closedDate_thru"] = convertIsoToMillis(state.query.closedDate.thru)
}
// closed after date
if(state.query.closedDate?.from) {
params["closedDate_from"] = convertIsoToMillis(state.query.closedDate.from)
}

try {
Expand Down

0 comments on commit 84989f7

Please sign in to comment.