mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-07 10:55:21 -05:00
fix: re-ordering of cookbooks (#5975)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
:delay="250"
|
||||
:delay-on-touch-only="true"
|
||||
style="width: 100%"
|
||||
@end="actions.updateOrder(myCookbooks)"
|
||||
@end="updateAll(myCookbooks)"
|
||||
>
|
||||
<v-expansion-panel
|
||||
v-for="(cookbook, index) in myCookbooks"
|
||||
@@ -160,7 +160,7 @@ export default defineNuxtComponent({
|
||||
});
|
||||
|
||||
const $auth = useMealieAuth();
|
||||
const { store: allCookbooks, actions } = useCookbookStore();
|
||||
const { store: allCookbooks, actions, updateAll } = useCookbookStore();
|
||||
|
||||
// Make a local reactive copy of myCookbooks
|
||||
const myCookbooks = ref<ReadCookBook[]>([]);
|
||||
@@ -170,7 +170,7 @@ export default defineNuxtComponent({
|
||||
myCookbooks.value
|
||||
= cookbooks?.filter(
|
||||
cookbook => cookbook.householdId === $auth.user.value?.householdId,
|
||||
) ?? [];
|
||||
).sort((a, b) => a.position > b.position) ?? [];
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
@@ -249,6 +249,9 @@ export default defineNuxtComponent({
|
||||
createTarget,
|
||||
createCookbook,
|
||||
|
||||
// update
|
||||
updateAll,
|
||||
|
||||
// delete
|
||||
deleteTarget,
|
||||
deleteEventHandler,
|
||||
|
||||
Reference in New Issue
Block a user