Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsfletch committed Dec 31, 2024
1 parent 668b3bd commit f3c6506
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 4 additions & 2 deletions packages/ui/src/providers/ServerFunctions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ type RenderDocument = (args: {
redirectAfterDelete?: boolean
redirectAfterDuplicate?: boolean
signal?: AbortSignal
}) => Promise<{ data: Data; Document: React.ReactNode } | ErrorResult>
}) => Promise<
{ data: Data; Document: React.ReactNode } | ({ data: never; Document: never } & ErrorResult)
>

type CopyDataFromLocaleClient = (
args: {
Expand Down Expand Up @@ -204,7 +206,7 @@ export const ServerFunctionsProvider: React.FC<{
const result = (await serverFunction({
name: 'render-document',
args: { fallbackLocale: false, ...rest },
})) as { data: Data; Document: React.ReactNode } | ErrorResult
})) as Awaited<ReturnType<typeof renderDocument>> // TODO: infer this type when `strictNullChecks` is enabled

handleErrors(result as ErrorResult)

Expand Down
20 changes: 9 additions & 11 deletions packages/ui/src/utilities/buildTableState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ type BuildTableStateSuccessResult = {
Table: React.ReactNode
}

type BuildTableStateErrorResult =
type BuildTableStateErrorResult = {
data?: any
renderedFilters?: never
state?: never
Table?: never
} & (
| {
data?: any
renderedFilters?: never
state?: never
Table?: never
message: string
}
| (
| {
message: string
}
| ErrorResult
)
| ErrorResult
)

export type BuildTableStateResult = BuildTableStateErrorResult | BuildTableStateSuccessResult

Expand Down

0 comments on commit f3c6506

Please sign in to comment.