Skip to content

Commit

Permalink
fix: update to roleName
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Sep 27, 2024
1 parent 01f08a3 commit e1b0244
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 requestedRole = useMemo(() => {
const roleName = 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, requestedRole, type: 'role'},
body: {note, requestUrl: window?.location.href, roleName, type: 'role'},
})
.then((request) => {
if (request) {
Expand Down

0 comments on commit e1b0244

Please sign in to comment.