new comment showing in comments panel
This commit is contained in:
parent
26369ad71b
commit
2c99811caf
5 changed files with 88 additions and 34 deletions
|
|
@ -137,7 +137,6 @@ export const useApiStore = defineStore("api", () => {
|
|||
} catch (error) {
|
||||
console.error(
|
||||
"Une erreur s'est produite lors de l'ajout du commentaire :",
|
||||
commentaire,
|
||||
error
|
||||
);
|
||||
throw error;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,19 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
export const useDialogStore = defineStore("dialog", () => {
|
||||
const content = ref(null);
|
||||
const openedFile = ref(null);
|
||||
const comments = computed(() => {
|
||||
return openedFile.value.comments;
|
||||
});
|
||||
|
||||
return { content };
|
||||
function updateFile(newFile) {
|
||||
content.value.files = content.value.files.map((file) =>
|
||||
file.id === newFile.id ? newFile : file
|
||||
);
|
||||
openedFile.value = newFile;
|
||||
}
|
||||
|
||||
return { content, openedFile, comments, updateFile };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue