feat(products): add thumbnail_url and image util
This commit is contained in:
parent
200193a999
commit
798f170989
2 changed files with 5 additions and 0 deletions
4
frontend/src/api/image.ts
Normal file
4
frontend/src/api/image.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { getApiBaseUrl } from "./base";
|
||||||
|
|
||||||
|
export const imageUrl = (path : string) =>
|
||||||
|
(new URL(`/image/${path}`, getApiBaseUrl())).toString();
|
||||||
1
frontend/src/api/types/product.d.ts
vendored
1
frontend/src/api/types/product.d.ts
vendored
|
|
@ -12,6 +12,7 @@ export interface Product {
|
||||||
sku: string;
|
sku: string;
|
||||||
short_description: string | null;
|
short_description: string | null;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
|
thumbnail_url: string | null;
|
||||||
price: string;
|
price: string;
|
||||||
stock_quantity: number;
|
stock_quantity: number;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue