From 93f396914c876af1cb4e0c5087de8350bc777903 Mon Sep 17 00:00:00 2001 From: Drew Lyton Date: Fri, 27 Sep 2024 10:33:14 -0400 Subject: [PATCH] back to requestedRole --- .../requestPermissionDialog/RequestPermissionDialog.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx index 88d0c806517..28341ccc5a6 100644 --- a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx +++ b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx @@ -70,7 +70,7 @@ export function RequestPermissionDialog({ }, [projectId, client]) // Set a default requestedRole based on the available roles - const roleName = useMemo(() => { + const requestedRole = useMemo(() => { const hasEditor = roles?.find((role) => role.name === 'editor') return hasEditor ? 'Editor' : 'Administrator' }, [roles]) @@ -81,7 +81,7 @@ export function RequestPermissionDialog({ .request({ url: `/access/project/${projectId}/requests`, method: 'post', - body: {note, requestUrl: window?.location.href, roleName, type: 'role'}, + body: {note, requestUrl: window?.location.href, requestedRole, type: 'role'}, }) .then((request) => { if (request) {