Skip to content

Commit

Permalink
add file decrement logic, cleanup test button
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalNewsTV committed Nov 17, 2023
1 parent 8f406be commit 5c44522
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,13 @@ export default {
]),
handleFileDelete(value, doc_status, e) {
e.preventDefault()
let tag = this.form.well && isNaN(this.form.well) ? this.form.well.well_tag_number : this.form.well
let encodedFileName = encodeURIComponent(value)
let tag = this.form.well && isNaN(this.form.well) ? this.form.well.well_tag_number : this.form.well;
let encodedFileName = encodeURIComponent(value);
if(confirm(`Are you sure you want to delete file: \n${value}`)){
ApiService.deleteFile(`wells/${tag}/delete_document?filename=${encodedFileName}&private=${doc_status}`)
.then(() => {
this.$emit('fetchFiles')
ApiService.decrementFileCount(`wells/${tag}`, value.split("_")[1]);
this.$emit('fetchFiles');
})
}
},
Expand Down
6 changes: 0 additions & 6 deletions app/frontend/src/wells/views/WellDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Licensed under the Apache License, Version 2.0 (the "License");
<fieldset id="summary_fieldset" class="detail-section mb-3">
<legend>
<span class="h2">Well Summary</span>
<button @click="demoPress">Press me</button>
<div class="float-right d-print-none">
<router-link v-if="show.edit" :to="{ name: 'SubmissionsEdit', params: { id } }" class="mr-3">
<button class="btn btn-primary mb-1">Edit</button>
Expand Down Expand Up @@ -638,11 +637,6 @@ export default {
...mapGetters(['userRoles', 'config', 'well', 'wellLicence', 'storedWellId', 'codes'])
},
methods: {
demoPress() {
console.log("WTN", this.storedWellId)
ApiService.incrementFileCount(`wells/${this.storedWellId}`, "Well Inspection")
ApiService.decrementFileCount(`wells/${this.storedWellId}`, "Well Inspection")
},
handlePrint () {
if (window.ga) {
window.ga('send', 'event', 'Button', 'print', 'Wells Summary Print')
Expand Down

0 comments on commit 5c44522

Please sign in to comment.