From 364a4faa75772fd4ea9348708b61066fa7f44d02 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:31:57 -0700 Subject: [PATCH] Fix invalid auth error on project submit (#1655) --- pages/[type]/[id]/moderation.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pages/[type]/[id]/moderation.vue b/pages/[type]/[id]/moderation.vue index 699676911..5f00c4457 100644 --- a/pages/[type]/[id]/moderation.vue +++ b/pages/[type]/[id]/moderation.vue @@ -124,6 +124,7 @@ const props = defineProps({ const app = useNuxtApp() const auth = await useAuth() +const tags = useTags() const { data: thread } = await useAsyncData(`thread/${props.project.thread_id}`, () => useBaseFetch(`thread/${props.project.thread_id}`) @@ -138,10 +139,14 @@ async function setStatus(status) { method: 'PATCH', body: data, }) - await useBaseFetch(`thread/${props.project.thread_id}/read`, { - method: 'POST', - body: data, - }) + + if (tags.value.staffRoles.includes(auth.value.user.role)) { + await useBaseFetch(`thread/${props.project.thread_id}/read`, { + method: 'POST', + body: data, + }) + } + const project = props.project project.status = status await props.resetProject()