Merged in fix/LOY-391-fix-for-transaction-details-not-available (pull request #3513)

fix(LOY-391): uses transaction date if checkinDate does not exist

* fix(LOY-391): uses transaction date if checkinDate does not exist

* fix(LOY-391): changed date to datejs and fixed description for reward night and reward gift

* fix(LOY-391):use year transaction date

* fix(LOY-391): fixed date timezone and dt() instead of datejs()

* fix(LOY-391): small improv with year

* fix(LOY-391): utc fix

* fix(LOY-391): changed sorting order on transaction date

* fix(LOY-391): filter out transactions with 0 award points


Approved-by: Joakim Jäderberg
This commit is contained in:
Emma Zettervall
2026-01-30 14:59:14 +00:00
parent 76ee5e97bf
commit 2f73fce6f2
3 changed files with 48 additions and 38 deletions

View File

@@ -279,21 +279,17 @@ export const userQueryRouter = router({
language
)
const allTransactions = updatedData
.filter((t) => t.type !== Transactions.rewardType.expired)
.filter(
(t) =>
t.type !== Transactions.rewardType.expired &&
t.attributes.awardPoints !== 0
)
.sort((a, b) => {
if (a.attributes.confirmationNumber === BALFWD) return 1
if (b.attributes.confirmationNumber === BALFWD) return -1
const dateA = new Date(
a.attributes.checkinDate
? a.attributes.checkinDate
: a.attributes.transactionDate
)
const dateB = new Date(
b.attributes.checkinDate
? b.attributes.checkinDate
: b.attributes.transactionDate
)
const dateA = new Date(a.attributes.transactionDate)
const dateB = new Date(b.attributes.transactionDate)
return dateA > dateB ? -1 : 1
})