Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore(set): Use the existing AvailableRoutes type (#11767)" #11904

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { AvailableRoutes } from '@redwoodjs/router'
import type { routes } 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 AvailableRoutes
unauthenticated?: keyof typeof routes
/**
* 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 AvailableRoutes
unauthenticated: keyof typeof routes
}

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