mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
fix: foreignKeys references signature
This commit is contained in:
parent
4aaf393318
commit
02e582514b
1 changed files with 2 additions and 2 deletions
|
@ -197,12 +197,12 @@ export type FieldsConfig = z.input<typeof collectionSchema>['fields'];
|
|||
interface CollectionConfig<TFields extends FieldsConfig>
|
||||
// use `extends` to ensure types line up with zod,
|
||||
// only adding generics for type completions.
|
||||
extends Pick<z.input<typeof collectionSchema>, 'fields' | 'indexes'> {
|
||||
extends Pick<z.input<typeof collectionSchema>, 'fields' | 'indexes' | 'foreignKeys'> {
|
||||
fields: TFields;
|
||||
foreignKeys?: Array<{
|
||||
fields: MaybeArray<Extract<keyof TFields, string>>;
|
||||
// TODO: runtime error if parent collection doesn't match for all fields. Can't put a generic here...
|
||||
references: MaybeArray<ReferenceableField>;
|
||||
references: () => MaybeArray<ReferenceableField>;
|
||||
}>;
|
||||
indexes?: Record<string, IndexConfig<TFields>>;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue