mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-04-27 15:09:13 +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) {
|
if (!this.Post || !this.Post[0].id) {
|
||||||
return
|
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]
|
return this.Post[0]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -40,6 +43,9 @@ export default {
|
|||||||
createdAt
|
createdAt
|
||||||
slug
|
slug
|
||||||
image
|
image
|
||||||
|
author {
|
||||||
|
id
|
||||||
|
}
|
||||||
tags {
|
tags {
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user