File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const authDataSchema = v.object({
1414} ) ;
1515
1616export type AuthData = v . Infer < typeof authDataSchema > ;
17+ export type Role = AuthData [ 'role' ] ;
1718
1819export function assertIsLoggedIn (
1920 authData : AuthData | undefined ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111 type ExpressionBuilder ,
1212 type Row ,
1313} from '@rocicorp/zero' ;
14- import type { AuthData } from './auth.ts' ;
14+ import type { AuthData , Role } from './auth.ts' ;
1515
1616// Table definitions
1717const user = table ( 'user' )
@@ -20,7 +20,7 @@ const user = table('user')
2020 login : string ( ) ,
2121 name : string ( ) . optional ( ) ,
2222 avatar : string ( ) ,
23- role : enumeration < 'user' | 'crew' > ( ) ,
23+ role : enumeration < Role > ( ) ,
2424 } )
2525 . primaryKey ( 'id' ) ;
2626
@@ -35,7 +35,7 @@ const issue = table('issue')
3535 creatorID : string ( ) ,
3636 assigneeID : string ( ) . optional ( ) ,
3737 description : string ( ) ,
38- visibility : string ( ) ,
38+ visibility : enumeration < 'internal' | 'public' > ( ) ,
3939 } )
4040 . primaryKey ( 'id' ) ;
4141
Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ export function IssuePage({onReady}: {onReady: () => void}) {
543543 { login . loginState ?. decoded . role === 'crew' ? (
544544 < div className = "sidebar-item" >
545545 < p className = "issue-detail-label" > Visibility</ p >
546- < Combobox
546+ < Combobox < 'public' | 'internal' >
547547 editable = { false }
548548 disabled = { ! canEdit }
549549 items = { [
You can’t perform that action at this time.
0 commit comments