Skip to content

Commit 61bda43

Browse files
committed
feat: ajout le tri sur les exploitations hors-ligne
Signed-off-by: Maud Royer <[email protected]>
1 parent cdaa56e commit 61bda43

File tree

1 file changed

+3
-2
lines changed
  • src/pages/certification/exploitations

1 file changed

+3
-2
lines changed

Diff for: src/pages/certification/exploitations/index.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ meta:
108108
</td>
109109
</tr>
110110
</tbody>
111-
<tfoot v-if="!isSearching && hasResults">
111+
<tfoot v-if="!isSearching && hasResults && isOnline">
112112
<tr>
113113
<td colspan="3" class="results-total">{{ operators.length }} sur {{ pagination.total }} résultats</td>
114114
<td>
@@ -198,7 +198,8 @@ const isSearching = ref(false)
198198
const searchResults = ref([])
199199
const operators = computed(() => isOnline.value ? searchResults.value : Object.entries(storage.operators).map(
200200
([, { records, operator }]) => ({ ...operator, ...records[0] })
201-
))
201+
).sort((a, b) => ((a[sortOrder.value.sort] < b[sortOrder.value.sort]) ^ (sortOrder.value.order === 'desc'))
202+
? -1 : 1))
202203
203204
// controlled by the form
204205
const userInput = ref(props.search)

0 commit comments

Comments
 (0)