Skip to content

Commit

Permalink
feat(custodial orders): fixed date format to be in ISO with Z at the …
Browse files Browse the repository at this point in the history
…ned which is expected from BE side
  • Loading branch information
milan-bc committed May 19, 2022
1 parent 1aa40b6 commit d1f7140
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { formatISO } from 'date-fns'
import { call, put, select } from 'redux-saga/effects'

import { APIType } from '@core/network/api'
Expand Down Expand Up @@ -51,18 +50,18 @@ export default ({ api }: { api: APIType }) => {
// get all
} else if (oldestTx) {
// get all after the oldest tx on the first page
after = formatISO(oldestTx.insertedAt)
after = new Date(oldestTx.insertedAt).toISOString()
}
} else {
if (!page[0]) return []
// subsequent pages
// before the newest
if (newestTx) {
before = formatISO(newestTx.insertedAt)
before = new Date(newestTx.insertedAt).toISOString()
}
// after the oldest
if (oldestTx) {
after = formatISO(oldestTx.insertedAt)
after = new Date(oldestTx.insertedAt).toISOString()
}
}

Expand Down

0 comments on commit d1f7140

Please sign in to comment.