reply comment on 360 working
This commit is contained in:
parent
d727f1a1af
commit
f790653fcf
8 changed files with 38 additions and 18 deletions
|
|
@ -127,6 +127,8 @@ export const useApiStore = defineStore("api", () => {
|
|||
body: JSON.stringify(comment),
|
||||
};
|
||||
|
||||
console.log("Commentaire à enregistrer :", comment);
|
||||
|
||||
try {
|
||||
const response = await fetch("/create-comment.json", headers);
|
||||
if (!response.ok) {
|
||||
|
|
@ -172,6 +174,8 @@ export const useApiStore = defineStore("api", () => {
|
|||
body: JSON.stringify(comment),
|
||||
};
|
||||
|
||||
console.log("Réponse à enregistrer :", comment);
|
||||
|
||||
try {
|
||||
const response = await fetch("/reply-comment.json", headers);
|
||||
if (!response.ok) {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,14 @@ import { useRoute } from "vue-router";
|
|||
export const useDialogStore = defineStore("dialog", () => {
|
||||
const content = ref(null);
|
||||
const openedFile = ref(null);
|
||||
const activeTracks = ref(null);
|
||||
|
||||
const comments = computed(() => {
|
||||
if (activeTracks.value?.length > 0) {
|
||||
return activeTracks.value[0].files.flatMap((file) =>
|
||||
file.comments ? file.comments : []
|
||||
);
|
||||
}
|
||||
return openedFile.value.comments;
|
||||
});
|
||||
|
||||
|
|
@ -81,6 +87,7 @@ export const useDialogStore = defineStore("dialog", () => {
|
|||
function setCommentMarkers() {
|
||||
if (!comments.value) return;
|
||||
comments.value.forEach((comment) => {
|
||||
if (comment.location.file.uuid !== openedFile.value.uuid) return;
|
||||
const bubble = document.createElement("a");
|
||||
|
||||
bubble.classList.add("comment-marker");
|
||||
|
|
@ -129,6 +136,7 @@ export const useDialogStore = defineStore("dialog", () => {
|
|||
|
||||
return {
|
||||
content,
|
||||
activeTracks,
|
||||
openedFile,
|
||||
comments,
|
||||
draftComment,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue