aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/components/forum/ForumApp.vue
diff options
context:
space:
mode:
Diffstat (limited to 'resources/vue/components/forum/ForumApp.vue')
-rw-r--r--resources/vue/components/forum/ForumApp.vue13
1 files changed, 11 insertions, 2 deletions
diff --git a/resources/vue/components/forum/ForumApp.vue b/resources/vue/components/forum/ForumApp.vue
index 60c8f8d..372a077 100644
--- a/resources/vue/components/forum/ForumApp.vue
+++ b/resources/vue/components/forum/ForumApp.vue
@@ -3,8 +3,7 @@ import {onMounted} from "vue";
import {useForumConfig} from "../../store/pinia/forum/ForumConfig";
const forumConfig = useForumConfig();
-
-onMounted(async () => {
+const fetchConfigs = async () => {
try {
const response = await STUDIP.jsonapi.withPromises().GET(`courses/${STUDIP.URLHelper.parameters.cid}/forum-configs`);
@@ -17,6 +16,16 @@ onMounted(async () => {
} catch (error) {
STUDIP.Report.error(error.statusText);
}
+}
+
+onMounted(async () => {
+ if (STUDIP.USER_ID === 'nobody') {
+ forumConfig.$patch({
+ allowGuestAccess: true
+ });
+ } else {
+ await fetchConfigs();
+ }
})
</script>