<script setup>
import { reset } from "@formkit/core";
import { q, m, notify } from "#imports";
const { my } = await q({
  my: {
    phone: true,
    addr1: true,
    addr2: true,
    addr3: true
  }
});
const onSubmit = (data, form) => {
  return m("updateMy", {
    data: {
      phone: data.phone,
      addr1: data.addr1,
      addr2: data.addr2,
      addr3: data.addr3
    }
  }).then(() => {
    notify("Your information has been updated");
    reset(form, data);
  });
};
</script>

<template>
    <FormKit type="l-form" :value="my" :bordered="false" @submit="onSubmit">
        <FormKit type="l-input" label="Phone" name="phone"></FormKit>
        <FormKit type="l-input" label="Address1" name="addr1"></FormKit>
        <FormKit type="l-input" label="Address2" name="addr2"></FormKit>
        <FormKit type="l-input" label="Address3" name="addr3"></FormKit>
    </FormKit>
</template>
