fix #87
This commit is contained in:
parent
abda2e4025
commit
cf0d4b7c6f
5 changed files with 17 additions and 8 deletions
|
|
@ -30,7 +30,7 @@
|
|||
}}
|
||||
</p>
|
||||
<div
|
||||
v-if="comment.author.uuid === userStore.user.uuid"
|
||||
v-if="userStore.canEditComment(comment)"
|
||||
class="comment__ctas | mt-8"
|
||||
>
|
||||
<button class="btn btn--transparent btn--icon btn--sm" data-icon="edit">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { defineStore, storeToRefs } from "pinia";
|
||||
import { usePageStore } from "./page";
|
||||
|
||||
export const useBriefStore = defineStore("brief", () => {
|
||||
async function addPdf(event, briefUri, redirectToParent = false) {
|
||||
const file = event.target.files[0];
|
||||
const { page } = usePageStore();
|
||||
const { page } = storeToRefs(usePageStore());
|
||||
|
||||
if (file) {
|
||||
const formData = new FormData();
|
||||
|
|
@ -20,7 +19,7 @@ export const useBriefStore = defineStore("brief", () => {
|
|||
const result = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
page.value = result;
|
||||
page.value.steps[0].files.push(result);
|
||||
} else {
|
||||
console.error("Error uploading file:", result.error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,15 @@ export const useUserStore = defineStore("user", () => {
|
|||
});
|
||||
}
|
||||
|
||||
return { user, notifications, readNotification, readAllNotifications };
|
||||
function canEditComment(comment) {
|
||||
return user.value.uuid === comment.author.uuid;
|
||||
}
|
||||
|
||||
return {
|
||||
user,
|
||||
notifications,
|
||||
readNotification,
|
||||
readAllNotifications,
|
||||
canEditComment,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import Header from "../components/project/Header.vue";
|
|||
import DialogWrapper from "../components/project/DialogWrapper.vue";
|
||||
import { usePageStore } from "../stores/page";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { computed, watch } from "vue";
|
||||
import { watch } from "vue";
|
||||
import { useDialogStore } from "../stores/dialog";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue