Fix Galerie
This commit is contained in:
@@ -5,7 +5,7 @@ import { ref } from "vue";
|
||||
import Modal from "../Modal.vue";
|
||||
import { Formular } from "../../dto/formular.dto";
|
||||
|
||||
const { $gql } = useNuxtApp();
|
||||
const { $gql, $myfetch } = useNuxtApp();
|
||||
|
||||
const forms = await $gql.request<{formulare: Formular[] }>(`
|
||||
{
|
||||
@@ -35,26 +35,17 @@ const forms = await $gql.request<{formulare: Formular[] }>(`
|
||||
).then(data=>data.formulare);
|
||||
|
||||
|
||||
const props=defineProps({
|
||||
formid: {
|
||||
type: [Number, null],
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
function submit($event: Event) {
|
||||
/*const url = new URL(
|
||||
RitzenbergenLib.RitzenbergenLib.api("/formulare/submit.php")
|
||||
);
|
||||
console.log($event);
|
||||
if($event.target==null) return;
|
||||
const formData = new FormData(<HTMLFormElement>$event.target);
|
||||
fetch(url.toString(), {
|
||||
const body = Object.fromEntries(formData);
|
||||
$myfetch("/formulare/submit/"+(<HTMLFormElement>$event.target).dataset.formid,{
|
||||
method: "POST",
|
||||
body: formData
|
||||
body
|
||||
}).then(() => {
|
||||
init();
|
||||
values.value={};
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
||||
const modalOpened=ref<boolean>(false);
|
||||
@@ -102,9 +93,9 @@ const values=ref({});
|
||||
data-form-title="Form Name"
|
||||
:data-formid="form.id"
|
||||
:data-i="i"
|
||||
@submit.prevent="submit"
|
||||
>
|
||||
|
||||
<!-- @submit.prevent="submit" -->
|
||||
<div v-for="(field, j) in form.fields" :key="j">
|
||||
<label
|
||||
v-if="field.placeholder == null"
|
||||
@@ -156,7 +147,6 @@ const values=ref({});
|
||||
Absenden
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" :value="form.id" name="internalformid" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user