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"},
|
* cascade={"persist"},
|
||||||
* )
|
* )
|
||||||
* @Groups({"read"})
|
* @Groups({"read"})
|
||||||
|
* @ORM\JoinColumn(onDelete="SET NULL")
|
||||||
*/
|
*/
|
||||||
private ?Comment $pinnedComment = null;
|
private ?Comment $pinnedComment = null;
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeComment() {
|
removeComment() {
|
||||||
this.$store.dispatch('removePinnedComment', {})
|
this.$store.dispatch('removePinnedComment', {id: this.pinnedComment.id})
|
||||||
.catch(({name, violations}) => {
|
.catch(({name, violations}) => {
|
||||||
if (name === 'ValidationException' || name === 'AccessException') {
|
if (name === 'ValidationException' || name === 'AccessException') {
|
||||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||||
|
@ -342,8 +342,9 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
/**
|
/**
|
||||||
* Add/remove pinnedComment
|
* Add/remove pinnedComment
|
||||||
*/
|
*/
|
||||||
removePinnedComment({ commit }) { //DOES NOT WORK
|
removePinnedComment({ commit }, payload) { //DOES NOT WORK
|
||||||
const body = {type: "accompanying_period_comment"};
|
|
||||||
|
const body = {type: "accompanying_period_comment", id: payload.id};
|
||||||
const url = `/api/1.0/person/accompanying-course/${id}/comment.json`;
|
const url = `/api/1.0/person/accompanying-course/${id}/comment.json`;
|
||||||
|
|
||||||
return makeFetch('DELETE', url, body)
|
return makeFetch('DELETE', url, body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user