mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 09:29:25 +02:00
See #890: make report category updatable
This commit is contained in:
parent
728160c71d
commit
94b9db062d
5 changed files with 77 additions and 4 deletions
|
@ -29,8 +29,10 @@
|
|||
<translate translate-context="*/*/*">Category</translate>
|
||||
</td>
|
||||
<td>
|
||||
<i class="tag icon"></i>
|
||||
{{ obj.type }}
|
||||
<report-category-dropdown
|
||||
class="field"
|
||||
:value="obj.type"
|
||||
@input="update({type: $event})"></report-category-dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -210,9 +212,11 @@ import axios from 'axios'
|
|||
import { diffWordsWithSpace } from 'diff'
|
||||
import NoteForm from '@/components/manage/moderation/NoteForm'
|
||||
import NotesThread from '@/components/manage/moderation/NotesThread'
|
||||
import ReportCategoryDropdown from '@/components/moderation/ReportCategoryDropdown'
|
||||
import entities from '@/entities'
|
||||
import showdown from 'showdown'
|
||||
|
||||
|
||||
function castValue (value) {
|
||||
if (value === null || value === undefined) {
|
||||
return ''
|
||||
|
@ -228,9 +232,10 @@ export default {
|
|||
components: {
|
||||
NoteForm,
|
||||
NotesThread,
|
||||
ReportCategoryDropdown,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
return {
|
||||
markdown: new showdown.Converter(),
|
||||
isLoading: false,
|
||||
}
|
||||
|
@ -290,7 +295,7 @@ export default {
|
|||
} else {
|
||||
return this.obj.target_state._target
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
remove () {
|
||||
|
@ -306,6 +311,17 @@ export default {
|
|||
self.isLoading = false
|
||||
})
|
||||
},
|
||||
update (payload) {
|
||||
let url = `manage/moderation/reports/${this.obj.uuid}/`
|
||||
let self = this
|
||||
this.isLoading = true
|
||||
axios.patch(url, payload).then((response) => {
|
||||
self.$emit('updated', payload)
|
||||
self.isLoading = false
|
||||
}, error => {
|
||||
self.isLoading = false
|
||||
})
|
||||
},
|
||||
resolve (v) {
|
||||
let url = `manage/moderation/reports/${this.obj.uuid}/`
|
||||
let self = this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue