Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 30b90bb

Browse files
authored
Merge pull request #21 from payloadcms/fix/parent-types
fix: createParentField types
2 parents 2b14a8f + 435b251 commit 30b90bb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

demo/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,9 +1204,9 @@ caniuse-api@^3.0.0:
12041204
lodash.uniq "^4.5.0"
12051205

12061206
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001426:
1207-
version "1.0.30001431"
1208-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795"
1209-
integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==
1207+
version "1.0.30001504"
1208+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001504.tgz"
1209+
integrity sha512-5uo7eoOp2mKbWyfMXnGO9rJWOGU8duvzEiYITW+wivukL7yHH4gX9yuRaobu6El4jPxo6jKZfG+N6fB621GD/Q==
12101210

12111211
chalk@^2.0.0:
12121212
version "2.4.2"

src/fields/parent.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import type { RelationshipField } from 'payload/dist/fields/config/types'
2-
import type { Field } from 'payload/types'
32

4-
const createParentField = (relationTo: string, overrides?: Partial<RelationshipField>): Field => ({
3+
const createParentField = (
4+
relationTo: string,
5+
overrides?: Partial<
6+
RelationshipField & {
7+
hasMany: false
8+
}
9+
>,
10+
): RelationshipField => ({
511
name: 'parent',
612
relationTo,
713
type: 'relationship',

0 commit comments

Comments
 (0)