mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-08 15:00:37 -04:00
(nuxt) call /api/admin/moderation only when permissions are detected to prevent 401 response (not user-visible)
This commit is contained in:
parent
aba7e48315
commit
3ead228fb9
@ -10,7 +10,14 @@ const props = withDefaults(defineProps<{
|
||||
label: 'Moderation rules',
|
||||
});
|
||||
|
||||
const { data: moderation } = await useFetch('/api/admin/moderation', { server: false, lazy: true, pick: [props.type] });
|
||||
const { $isGranted: isGranted } = useNuxtApp();
|
||||
|
||||
const { data: moderation } = await useFetch('/api/admin/moderation', {
|
||||
immediate: isGranted('panel'),
|
||||
server: false,
|
||||
lazy: true,
|
||||
pick: [props.type],
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
x
Reference in New Issue
Block a user