1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

fix: all-recipes page now sorts alphabetically (#1405)

* added sort params to backend call

* hardcoded alphabetical sort param

* removed trivial type annotation

* linters are friends, not food
This commit is contained in:
Michael Genson 2022-06-19 13:03:24 -05:00 committed by GitHub
parent d4b92a8ade
commit bb1fa52d10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -61,8 +61,8 @@ export const useLazyRecipes = function () {
const recipes = ref<Recipe[]>([]);
async function fetchMore(start: number, limit: number) {
const { data } = await api.recipes.getAll(start, limit);
async function fetchMore(start: number, limit: number, orderBy: string | null = null, orderDescending = true) {
const { data } = await api.recipes.getAll(start, limit, { orderBy, orderDescending });
if (data) {
data.forEach((recipe) => {
recipes.value?.push(recipe);