mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-26 00:21:54 +08:00
feat: support deleting logs based on filtering results (#35)
* feat: support deleting logs based on filtering results * fix(record): fix the problem of wrong number of parameters when outputting delete logs
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
</style>
|
||||
<script>
|
||||
|
||||
import {getHttpRecord} from '@/api/record'
|
||||
import {getHttpRecord, deleteHttpRecord} from '@/api/record'
|
||||
import {store} from '@/main'
|
||||
import FilterDropdown from '@/components/FilterDropdown'
|
||||
|
||||
@@ -179,6 +179,21 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
delete: function () {
|
||||
let params = {
|
||||
...this.filters,
|
||||
}
|
||||
this.loading = true;
|
||||
deleteHttpRecord(params).then(() => {
|
||||
this.$message.success('Deleted successfully')
|
||||
this.filters = {}
|
||||
this.fetch()
|
||||
}).catch(e => {
|
||||
if (e.response.status !== 403) {
|
||||
this.$message.error('Failed to delete: ' + e.response.data.error)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetch();
|
||||
|
||||
Reference in New Issue
Block a user