Skip to content

Commit

Permalink
fix(types): Correct the type for Field['items'] (#313)
Browse files Browse the repository at this point in the history
The `items` attribute in a Content Type is not an array, it's an object, and it gives a summary of the types that are IN the array. This PR fixes the type. Example response straight from the API for proof:

```json
{
  "id": "logos",
  "name": "Logos",
  "type": "Array",
  "localized": false,
  "required": true,
  "validations": [{ "size": { "min": 5, "max": 15 } }],
  "disabled": false,
  "omitted": false,
  "items": {
    "type": "Link",
    "validations": [{ "linkContentType": ["logo"] }],
    "linkType": "Entry"
  }
}
```
  • Loading branch information
stevenpetryk authored and Khaledgarbaya committed Mar 11, 2019
1 parent 89c662c commit 810cd6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export interface Field {
required: boolean;
type: FieldType;
validations: FieldValidation[];
items?: FieldItem[];
items?: FieldItem;
}

export type FieldType = 'Symbol' | 'Text' | 'Integer' | 'Number' | 'Date' | 'Boolean' | 'Location' | 'Link' | 'Array' | 'Object' | 'RichText';
Expand Down

0 comments on commit 810cd6e

Please sign in to comment.