Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
les
gancio
Commits
f0624b14
Commit
f0624b14
authored
May 22, 2020
by
les
Browse files
ask before remove resources
parent
1ee9cdc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/admin/Moderation.vue
View file @
f0624b14
...
...
@@ -68,7 +68,7 @@
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
import
{
Message
,
MessageBox
}
from
'
element-ui
'
import
{
MessageBox
}
from
'
element-ui
'
export
default
{
name
:
'
Moderation
'
,
...
...
@@ -142,15 +142,17 @@ export default {
ap_user
.
blocked
=
!
ap_user
.
blocked
}
catch
(
e
)
{
}
},
async
deleteResource
(
resource
)
{
await
MessageBox
.
confirm
(
this
.
$t
(
'
admin.delete_resource_confirm
'
),
deleteResource
(
resource
)
{
MessageBox
.
confirm
(
this
.
$t
(
'
admin.delete_resource_confirm
'
),
this
.
$t
(
'
common.confirm
'
),
{
confirmButtonText
:
this
.
$t
(
'
common.ok
'
),
cancelButtonText
:
this
.
$t
(
'
common.cancel
'
),
type
:
'
error
'
})
await
this
.
$axios
.
delete
(
`/resources/
${
resource
.
id
}
`
)
this
.
resources
=
this
.
resources
.
filter
(
r
=>
r
.
id
!==
resource
.
id
)
}
).
then
(()
=>
{
this
.
$axios
.
delete
(
`/resources/
${
resource
.
id
}
`
)
this
.
resources
=
this
.
resources
.
filter
(
r
=>
r
.
id
!==
resource
.
id
)
})
},
async
toggleBlock
(
instance
)
{
await
this
.
$axios
.
post
(
'
/instances/toggle_block
'
,
{
instance
:
instance
.
domain
,
blocked
:
!
instance
.
blocked
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment