Skip to content

CreateDataAttributeRequest incorrectly typed #513

@JordhanMadec

Description

@JordhanMadec

Currently this is typed as follow :

export type CreateDataAttributeRequest = {
    data_type?: "options" | undefined;
    options: {
        value?: string | undefined;
    }[];
} | {
    data_type?: ("string" | "integer" | "float" | "boolean" | "datetime" | "date") | undefined;
};

However, according to API docs, we should also be able to set the following fields : name, model, description and messenger_writable

Therefore, we should have something like this :

interface CreateDataAttributeRequestBase {
    name: string;
    model: 'company' | 'contact';
    description?: string;
    messenger_writable?: boolean;
}

export type CreateDataAttributeRequest = CreateDataAttributeRequestBase & {
    data_type?: "options" | undefined;
    options: {
        value?: string | undefined;
    }[];
} | CreateDataAttributeRequestBase & {
    data_type?: ("string" | "integer" | "float" | "boolean" | "datetime" | "date") | undefined;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions