From 15c85163fd3f602c92e8cabd8bb3e8683bb3c493 Mon Sep 17 00:00:00 2001 From: Linus Flood Date: Mon, 30 Jun 2025 08:44:11 +0000 Subject: [PATCH] Merged in fix/SW-3122-destionations-sort (pull request #2471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-3122): copy array before sorting since it can be immutible * fix(SW-3122): copy array before sorting since it can be immutible Approved-by: Matilda Landström --- apps/scandic-web/stores/destination-data/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/scandic-web/stores/destination-data/helper.ts b/apps/scandic-web/stores/destination-data/helper.ts index 842e06b25..04a2c4d33 100644 --- a/apps/scandic-web/stores/destination-data/helper.ts +++ b/apps/scandic-web/stores/destination-data/helper.ts @@ -56,7 +56,7 @@ export function getSortedHotels( sortOption: SortOption ) { const sortFn = HOTEL_SORTING_STRATEGIES[sortOption] - return sortFn ? hotels.sort(sortFn) : hotels + return sortFn ? [...hotels].sort(sortFn) : hotels } export function isValidSortOption(