You've already forked gun-manager-frontend
derp, helper method rename
This commit is contained in:
@@ -79,12 +79,11 @@
|
||||
<router-link to="/guns">
|
||||
<Button class="p-button-warning ml-3" icon="fa-sharp fa-light fa-times" label="Cancel"/>
|
||||
</router-link>
|
||||
<Button @click="deleteGun" v-if="gun.id" class="p-button-danger ml-3" icon="fa-sharp fa-light fa-trash" label="Delete"/>
|
||||
<Button @click="confirm" v-if="gun.id" class="p-button-danger ml-3" icon="fa-sharp fa-light fa-trash" label="Delete"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Card>
|
||||
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import {defineComponent} from "vue"
|
||||
@@ -109,6 +108,18 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
this.$confirm.require({
|
||||
message: 'Are you sure you want to proceed?',
|
||||
header: 'Confirmation',
|
||||
icon: 'pi pi-exclamation-triangle',
|
||||
accept: () => {
|
||||
this.deleteGun()
|
||||
},
|
||||
reject: () => {
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteGun() {
|
||||
axios.delete(`${import.meta.env.VITE_API}/gun/${this.gun.id}`)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user