Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Default address not being set when creating a new address with "default" checkbox enabled in cost center details storefront page

## [3.1.4] - 2026-01-15

### Fixed
Expand Down
6 changes: 5 additions & 1 deletion react/components/CostCenterDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ const CostCenterDetails: FunctionComponent<RouterProps> = ({
addressQuery: address.addressQuery.value,
} as Address

const newAddresses = [...addresses, newAddress]
// If the new address is marked as default, place it at the beginning of the array
// The backend considers the first address in the array as the default
const newAddresses = address.checked
? [newAddress, ...addresses]
: [...addresses, newAddress]

const variables = {
id: params.id,
Expand Down