Skip to content

Commit

Permalink
chore: merge types
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Sep 26, 2024
1 parent a2b4253 commit 05a05ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import {Button, Dialog} from '../../../ui-components'
import {NotAuthenticatedScreen} from './NotAuthenticatedScreen'

interface AccessRequest {
export interface AccessRequest {
id: string
status: 'pending' | 'accepted' | 'declined'
resourceId: string
Expand All @@ -22,6 +22,8 @@ interface AccessRequest {
updatedAt: string
updatedByUserId: string
requestedByUserId: string
requestedRole: string
type: 'access' | 'role'
note: string
}

Expand Down Expand Up @@ -127,7 +129,7 @@ export function RequestAccessScreen() {
.request<AccessRequest | null>({
url: `/access/project/${projectId}/requests`,
method: 'post',
body: {note, requestUrl: window?.location.href},
body: {note, requestUrl: window?.location.href, type: 'access'},
})
.then((request) => {
if (request) setHasPendingRequest(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@ import {useEffect, useId, useMemo, useState} from 'react'
import {type Role, useClient, useProjectId, useTranslation, useZIndex} from 'sanity'
import {styled} from 'styled-components'

import {type AccessRequest} from '../../../core/studio/screens'
import {Dialog} from '../../../ui-components'
import {structureLocaleNamespace} from '../../i18n'

interface AccessRequest {
id: string
status: 'pending' | 'accepted' | 'declined'
resourceId: string
resourceType: 'project'
createdAt: string
updatedAt: string
updatedByUserId: string
requestedByUserId: string
requestedRole: string
requestType: string
note: string
}

const MAX_NOTE_LENGTH = 150

/** @internal */
Expand Down

0 comments on commit 05a05ba

Please sign in to comment.