paginate in offset mode when querying emoji - fixes #490

since the backend sorts emojis by name length when a query is present,
the normal pagination with `sinceId` / `untilId` would not work
reliably

`offsetMode` is better in this case, although it will produce
non-stable results if custom emojis that match the query are added or
removed while we paginate
This commit is contained in:
dakkar 2024-04-07 17:50:53 +01:00
parent 40f08617c4
commit 2bb313e145

View file

@ -98,6 +98,9 @@ const selectedEmojis = ref<string[]>([]);
const pagination = { const pagination = {
endpoint: 'admin/emoji/list' as const, endpoint: 'admin/emoji/list' as const,
limit: 30, limit: 30,
offsetMode: computed(() => (
(query.value && query.value !== '') ? true : false
)),
params: computed(() => ({ params: computed(() => ({
query: (query.value && query.value !== '') ? query.value : null, query: (query.value && query.value !== '') ? query.value : null,
})), })),