Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/composables/useBrand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ export const useBrand = () => {
_params.brewery = await getReference(path)
}

await addItemFirestore(`${breweryPath}/brands`, params)
const res = await addItemFirestore(`${breweryPath}/brands`, params)
//削除
await deleteItem(brandPath)

return res
}

return {
Expand Down
23 changes: 23 additions & 0 deletions app/pages/breweries/[breweryId]/brands/[brandId]/updateScript.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
import { object, string, type InferType } from "yup"
import type { FormSubmitEvent } from "#ui/types"

const { t } = useI18n()
const route = useRoute()

const brandPath = route.query.brandPath
const breweryPath = route.query.breweryPath

const { getItem, moveItem } = useBrand()

const brand = await getItem(`/breweries/${route.params.breweryId}/brands/${route.params.brandId}`) // Do something with event.data
const res = await moveItem(brandPath, breweryPath, brand.data)
const newBrandPath = res.path

</script>

<template>
<div>
{{ newBrandPath }}
</div>
</template>