Skip to content

Commit

Permalink
Fix post sort (#225)
Browse files Browse the repository at this point in the history
Yet another wording confusion

Use `created_at` instead of `created` as post sort.

See non working sort https://www.data.gouv.fr/api/1/posts/?sort=-created
VS https://www.data.gouv.fr/api/1/posts/?sort=-created_at

Using a unknown field as sort leads to [undefined sort and duplicate
results](datagouv/data.gouv.fr#1072).
  • Loading branch information
maudetes authored Dec 27, 2024
1 parent 47b2e07 commit 1ec3a7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/beta/admin/site/posts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const { t } = useI18n()
const page = ref(1)
const pageSize = ref(10)
const sortedBy = ref<DiscussionSortedBy>('created')
const sortedBy = ref<DiscussionSortedBy>('created_at')
const direction = ref<SortDirection>('desc')
const sortDirection = computed(() => `${direction.value === 'asc' ? '' : '-'}${sortedBy.value}`)
const q = ref('')
Expand Down

0 comments on commit 1ec3a7d

Please sign in to comment.