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

feat: public recipe access (#1610)

* initial public explorer API endpoint

* public API endpoint

* cleanup recipe page

* wip: init explorer page

* use public URLs for shared recipes

* refactor private share tokens to use shared page
This commit is contained in:
Hayden 2022-08-28 20:08:33 -08:00 committed by GitHub
parent 9ea5e6584f
commit 18b2c92a76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 361 additions and 437 deletions

View file

@ -13,7 +13,7 @@
hide-details
class="pt-0 my-auto py-auto"
color="secondary"
@change="toolStore.actions.updateOne(recipe.tools[index])"
@change="updateTool(index)"
>
</v-checkbox>
<v-list-item-content>
@ -26,7 +26,7 @@
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api";
import { usePageState } from "~/composables/recipe-page/shared-state";
import { usePageState, usePageUser } from "~/composables/recipe-page/shared-state";
import { useToolStore } from "~/composables/store";
import { NoUndefinedField } from "~/types/api";
import { Recipe } from "~/types/api-types/recipe";
@ -48,12 +48,21 @@ export default defineComponent({
},
setup(props) {
const toolStore = useToolStore();
const { user } = usePageUser();
const { isEditMode } = usePageState(props.recipe.slug);
function updateTool(index: number) {
if (user.id) {
toolStore.actions.updateOne(props.recipe.tools[index]);
} else {
console.log("no user, skipping server update");
}
}
return {
toolStore,
isEditMode,
updateTool,
};
},
});