Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Type Definition for ItemLink #363

Closed
bouncehead13 opened this issue Apr 20, 2020 · 1 comment
Closed

Wrong Type Definition for ItemLink #363

bouncehead13 opened this issue Apr 20, 2020 · 1 comment
Assignees

Comments

@bouncehead13
Copy link

Description

The type definition for ComponentRendering is incorrect for ItemLink sources. Definition only allows ContentList sources.

Current behavior

Example payload

{
    "componentName": "<name>",
    "fields": {
        "header": "I am a header",
        "innerItem": { // type Item...not Item[]
            "fields": {
                "body": {
                    "value": "Inner Body"
                }
            }
        }
    }
}

Expected behavior

Type Definition for Item should allow reference to a single ItemLink definition

export interface ComponentFields {
    // allow Item type in addition to Item[]
    [name: string]: Field | Item | Item[];
}
export interface Item {
    name: string;
    displayName?: string;
    fields: {
        // allow Item type in addition to Item[]
        [name: string]: Field | Item | Item[] | undefined;
    };
}
@sc-illiakovalenko
Copy link
Contributor

@bouncehead13 Thank you. Fixed in #364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants