Skip to content

Commit

Permalink
export request populate param types
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderD99 committed Dec 19, 2024
1 parent dd0acc9 commit 497bf82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/types/v4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export interface Strapi4RequestParams<T> {
locale?: StrapiLocale
}

type Strapi4RequestPopulateParams<T> = Pick<Strapi4RequestParams<T>, 'fields' | 'sort' | 'populate' | 'filters'>
export type Strapi4RequestPopulateParams<T> = Pick<Strapi4RequestParams<T>, 'fields' | 'sort' | 'populate' | 'filters'>

// Unified type for Strapi populate, combining both string paths and nested objects.
type Strapi4RequestPopulateParam<T> =
export type Strapi4RequestPopulateParam<T> =
| '*' // Populate all relations.
| { [K in keyof T]?: // Nested object population.
T[K] extends object
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/types/v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export interface Strapi5RequestParams<T> {
locale?: StrapiLocale | null
}

type Strapi5RequestPopulateParams<T> = Pick<Strapi5RequestParams<T>, 'fields' | 'sort' | 'populate' | 'filters'>
export type Strapi5RequestPopulateParams<T> = Pick<Strapi5RequestParams<T>, 'fields' | 'sort' | 'populate' | 'filters'>

// Unified type for Strapi populate, combining both string paths and nested objects.
type Strapi5RequestPopulateParam<T> =
export type Strapi5RequestPopulateParam<T> =
| '*' // Populate all relations.
| { [K in keyof T]?: // Nested object population.
T[K] extends object
Expand Down

0 comments on commit 497bf82

Please sign in to comment.