Skip to content

Commit

Permalink
Merge pull request #54 from vtex-apps/fix/B2BTEAM-1932
Browse files Browse the repository at this point in the history
fix: Set viewedByCustomer is false, where is null
  • Loading branch information
pabloppupulin authored Oct 30, 2024
2 parents 49b9d04 + 8cb2ab9 commit 5d673bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Set viewedByCustomer value False when value is null

## [2.6.2] - 2024-10-02

### Added
Expand Down
4 changes: 2 additions & 2 deletions node/resolvers/mutations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ export const Mutation = {
status,
subtotal: subtotal ?? existingQuote.subtotal,
updateHistory,
viewedByCustomer: decline || isCustomer,
viewedBySales: decline || isSales,
viewedByCustomer: !!(decline || isCustomer),
viewedBySales: !!(decline || isSales),
}

const data = await masterdata
Expand Down
4 changes: 4 additions & 0 deletions node/utils/Queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const processItem = ({ ctx, item }: { ctx: Context; item: Quote }) => {
return
}

if (item.viewedByCustomer === null) {
item.viewedByCustomer = false
}

const status = 'expired'
const now = new Date()
const nowISO = now.toISOString()
Expand Down

0 comments on commit 5d673bf

Please sign in to comment.