You've already forked gun-manager-frontend
last hope failed, maybe now
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
<div class="w-full mt-5">
|
<div class="w-full mt-5">
|
||||||
<div class="flex gap-2" style="flex-direction: column">
|
<div class="flex gap-2" style="flex-direction: column">
|
||||||
<label for="date_purchased">Date Purchased</label>
|
<label for="date_purchased">Date Purchased</label>
|
||||||
<Calendar v-model="gun.date_purchased"/>
|
<Calendar date-format="mm/dd/yy" v-model="gun.date_purchased"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full mt-5">
|
<div class="w-full mt-5">
|
||||||
@@ -93,9 +93,7 @@ export default defineComponent({
|
|||||||
props: {
|
props: {
|
||||||
loading: {
|
loading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: () => {
|
default: false
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
gun: {
|
gun: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -110,7 +108,7 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
confirm() {
|
confirm() {
|
||||||
this.$confirm.require({
|
this.$confirm.require({
|
||||||
message: 'Are you sure you want to proceed?',
|
message: 'Are you sure you want to delete this gun?',
|
||||||
header: 'Confirmation',
|
header: 'Confirmation',
|
||||||
icon: 'pi pi-exclamation-triangle',
|
icon: 'pi pi-exclamation-triangle',
|
||||||
accept: () => {
|
accept: () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full flex flex-row flex-wrap justify-around">
|
<div class="w-full flex flex-row flex-wrap justify-around">
|
||||||
<div class="w-full lg:w-1/2 m-5">
|
<div class="w-full lg:w-1/2 m-5">
|
||||||
<GunForm @upload="getGun" v-if="gun" @save="save" :gun="gun"/>
|
<GunForm :loading="loading" @upload="getGun" v-if="gun" @save="save" :gun="gun"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-10 w-full lg:w-1/2 m-5">
|
<div class="mt-10 w-full lg:w-1/2 m-5">
|
||||||
<Card>
|
<Card>
|
||||||
@@ -36,11 +36,13 @@ import GunForm from "../components/GunForm.vue";
|
|||||||
|
|
||||||
interface Data {
|
interface Data {
|
||||||
gun: Guns | null
|
gun: Guns | null
|
||||||
|
loading: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {GunForm},
|
components: {GunForm},
|
||||||
data: (): Data => ({
|
data: (): Data => ({
|
||||||
|
loading: false,
|
||||||
gun: null
|
gun: null
|
||||||
}),
|
}),
|
||||||
created() {
|
created() {
|
||||||
@@ -65,7 +67,14 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
|
this.loading = true
|
||||||
|
axios.put(import.meta.env.VITE_API + `/gun/${this.$route.params.id}`, this.gun)
|
||||||
|
.then(() => {
|
||||||
|
this.getGun()
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user