360 : improve comment system
This commit is contained in:
parent
f790653fcf
commit
82e944cd31
2 changed files with 8 additions and 4 deletions
|
|
@ -216,6 +216,14 @@ async function addComment(newComment) {
|
||||||
resetDraftComment();
|
resetDraftComment();
|
||||||
isAddOpen.value = false;
|
isAddOpen.value = false;
|
||||||
dialog.updateFile(newFile);
|
dialog.updateFile(newFile);
|
||||||
|
activeTracks.value = activeTracks.value.map((track) => {
|
||||||
|
if (track.files) {
|
||||||
|
track.files = track.files.map((file) =>
|
||||||
|
file.uuid === newFile.uuid ? newFile : file
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return track;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetDraftComment() {
|
function resetDraftComment() {
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,6 @@ export const useApiStore = defineStore("api", () => {
|
||||||
body: JSON.stringify(comment),
|
body: JSON.stringify(comment),
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Commentaire à enregistrer :", comment);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch("/create-comment.json", headers);
|
const response = await fetch("/create-comment.json", headers);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
@ -174,8 +172,6 @@ export const useApiStore = defineStore("api", () => {
|
||||||
body: JSON.stringify(comment),
|
body: JSON.stringify(comment),
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Réponse à enregistrer :", comment);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch("/reply-comment.json", headers);
|
const response = await fetch("/reply-comment.json", headers);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue