comments / notifications : improve abstraction

This commit is contained in:
isUnknown 2024-11-18 12:00:19 +01:00
parent f467012241
commit 32c026acfe
11 changed files with 92 additions and 65 deletions

View file

@ -114,6 +114,7 @@ import { useApiStore } from "../../stores/api";
import { useDialogStore } from "../../stores/dialog";
import Comment from "./Comment.vue";
import { storeToRefs } from "pinia";
import { useRoute } from "vue-router";
dayjs.locale("fr");
@ -129,6 +130,7 @@ const newCommentPageIndex = ref(null);
const newCommentPosition = ref(null);
const newCommentText = ref("");
const isAddOpen = ref(false);
const route = useRoute();
const sortedComments = computed(() => comments.value.reverse());
const sortedReplies = ref(null);
@ -162,8 +164,8 @@ function handleSubmit(event = null) {
}
const date = dayjs().format();
const newComment = {
pageUri: page.uri + "/client-brief",
fileName: openedFile.value.name,
path: route.fullPath,
fileName: openedFile ? openedFile.value.name : false,
userUuid: user.uuid,
text: newCommentText.value,
date,