Skip to content

Commit

Permalink
Make featured_image nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
andershagbard committed Sep 29, 2023
1 parent 4b2cb4c commit b19fa2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Nullable<T> = { [K in keyof T]: T[K] | null };
8 changes: 5 additions & 3 deletions type/json/LineItem.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Nullable } from '../../helpers';

export default interface Item {
id: number;
properties: { [key: string]: any } | null;
Expand All @@ -18,14 +20,14 @@ export default interface Item {
final_price: number;
final_line_price: number;
url: string;
featured_image: {
featured_image: Nullable<{
aspect_ratio: number;
alt: string;
height: number;
url: string;
width: number;
};
image: string;
}>;
image: string | null;
handle: string;
requires_shipping: boolean;
product_type: string;
Expand Down

0 comments on commit b19fa2c

Please sign in to comment.