Skip to content

Commit

Permalink
back to requestedRole
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Sep 27, 2024
1 parent e1b0244 commit 93f3969
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -81,7 +81,7 @@ export function RequestPermissionDialog({
.request<AccessRequest | null>({
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) {
Expand Down

0 comments on commit 93f3969

Please sign in to comment.