mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
Throw error if the user is not the owner of the post while edit
This commit is contained in:
parent
37a81d59e5
commit
63925e4046
@ -25,6 +25,9 @@ export default {
|
||||
if (!this.Post || !this.Post[0].id) {
|
||||
return
|
||||
}
|
||||
if (this.Post[0].author.id !== this.$store.getters['auth/user'].id) {
|
||||
throw new Error(`You can't edit that!`)
|
||||
}
|
||||
return this.Post[0]
|
||||
}
|
||||
},
|
||||
@ -40,6 +43,9 @@ export default {
|
||||
createdAt
|
||||
slug
|
||||
image
|
||||
author {
|
||||
id
|
||||
}
|
||||
tags {
|
||||
name
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user