Skip to content

Commit

Permalink
chore(set): Use the existing AvailableRoutes type (#11767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Dec 12, 2024
1 parent 32fe410 commit f208c8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/router/src/Set.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactElement, ReactNode } from 'react'
import React from 'react'

import type { routes } from '@redwoodjs/router'
import type { AvailableRoutes } from '@redwoodjs/router'

type SetProps<P> = (P extends React.FC ? React.ComponentProps<P> : unknown) & {
/**
Expand All @@ -22,7 +22,7 @@ type SetProps<P> = (P extends React.FC ? React.ComponentProps<P> : unknown) & {
*
* @deprecated Please use `<PrivateSet>` instead and specify this prop there
*/
unauthenticated?: keyof typeof routes
unauthenticated?: keyof AvailableRoutes
/**
* Route is permitted when authenticated and user has any of the provided
* roles such as "admin" or ["admin", "editor"]
Expand All @@ -47,7 +47,7 @@ export function Set<WrapperProps>(props: SetProps<WrapperProps>) {

type PrivateSetProps<P> = Omit<SetProps<P>, 'private' | 'unauthenticated'> & {
/** The page name where a user will be redirected when not authenticated */
unauthenticated: keyof typeof routes
unauthenticated: keyof AvailableRoutes
}

/** @deprecated Please use `<PrivateSet>` instead */
Expand Down

0 comments on commit f208c8b

Please sign in to comment.