subfolder

This commit is contained in:
aarizona 2024-05-29 17:52:09 +03:00
parent 8c7e4332dd
commit 14c0054d7f
3 changed files with 12 additions and 3 deletions

View File

@ -12,6 +12,7 @@ type ExternalDataType = {
type StateDataType = { type StateDataType = {
partner?: string partner?: string
categories?: string[] categories?: string[]
inventory?: string
element?: string element?: string
element_id?: string element_id?: string
} }
@ -19,6 +20,7 @@ const loading = ref(false)
const state = reactive<StateDataType>({ const state = reactive<StateDataType>({
partner: undefined, partner: undefined,
categories: [], categories: [],
inventory: undefined,
element: undefined, element: undefined,
element_id: undefined element_id: undefined
}) })
@ -34,9 +36,10 @@ const schema = object({
type Schema = InferType<typeof schema> type Schema = InferType<typeof schema>
async function onSubmit(event: FormSubmitEvent<Schema>) { async function onSubmit(event: FormSubmitEvent<Schema>) {
console.log(event.data) const data = await $fetch(`${apiBase}/element/`, { method: 'POST', body: JSON.stringify(event.data) })
const data = $fetch(`${apiBase}/element/`, { method: 'POST', body: JSON.stringify(event.data) }) if(data.partner) {
console.log(data) // navigateTo(`/organization/${data.partner.id}`)
}
} }
const searchInExternal = (q: string) => { const searchInExternal = (q: string) => {

View File

@ -0,0 +1,3 @@
<template>
inv
</template>

View File

@ -0,0 +1,3 @@
<template>
partner
</template>