Skip to content

ImageField props conflict with API spec #31

@Mosnar

Description

@Mosnar

https://github.com/agility/agility-next/blob/796142a1b0dbe9a4e85e1d88996f13b3442e51ac/src/types.ts#L209C1-L216C2

The type definition for ImageField has all non-nullable properties; however, if I inspect the data returned from the API, I get:

"myImageField": {
    "label": null,
    "url": "url here",
    "target": null,
    "filesize": 396122,
    "pixelHeight": "304",
    "pixelWidth": "650",
    "height": 304,
    "width": 650
},

A more compliant type would look like this:

export interface ImageField {
  label: string | null;
  url: string;
  target: string | null;
  filesize: number;
  pixelHeight: string;
  pixelWidth: string;
  height: number;
  width: number;
}

This change should be backwards-compatible with AgilityPic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions