Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 la fonction de tri par dĂ©faut sur le DsfrDataTable #958

Merged
merged 3 commits into from
Oct 21, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/components/DsfrDataTable/DsfrDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
const highestLimit = computed(() => (currentPage.value + 1) * rowsPerPage.value)

function defaultSortFn (a: string | DsfrDataTableRow, b: string | DsfrDataTableRow) {
const key = props.sorted as string
const key = sortedBy.value ?? props.sorted

Check failure on line 68 in src/components/DsfrDataTable/DsfrDataTable.vue

View workflow job for this annotation

GitHub Actions / Run unit tests and CT tests

'sortedBy' was used before it was defined
// @ts-expect-error TS7015
if (((a as DsfrDataTableRow)[key] ?? a) < ((b as DsfrDataTableRow)[key] ?? b)) {
return -1
Expand Down
Loading