mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 21:46:14 +00:00
accompanying course comment: more tentative to delete the comment
This commit is contained in:
parent
f04118218d
commit
6472c554ed
@ -261,6 +261,7 @@ class AccompanyingPeriod implements
|
||||
* cascade={"persist"},
|
||||
* )
|
||||
* @Groups({"read"})
|
||||
* @ORM\JoinColumn(onDelete="SET NULL")
|
||||
*/
|
||||
private ?Comment $pinnedComment = null;
|
||||
|
||||
|
@ -107,7 +107,7 @@ export default {
|
||||
}
|
||||
},
|
||||
removeComment() {
|
||||
this.$store.dispatch('removePinnedComment', {})
|
||||
this.$store.dispatch('removePinnedComment', {id: this.pinnedComment.id})
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
|
@ -342,8 +342,9 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
||||
/**
|
||||
* Add/remove pinnedComment
|
||||
*/
|
||||
removePinnedComment({ commit }) { //DOES NOT WORK
|
||||
const body = {type: "accompanying_period_comment"};
|
||||
removePinnedComment({ commit }, payload) { //DOES NOT WORK
|
||||
|
||||
const body = {type: "accompanying_period_comment", id: payload.id};
|
||||
const url = `/api/1.0/person/accompanying-course/${id}/comment.json`;
|
||||
|
||||
return makeFetch('DELETE', url, body)
|
||||
|
Loading…
x
Reference in New Issue
Block a user