latest
This commit is contained in:
@@ -41,8 +41,8 @@ export default class PrintfulService {
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
console.error("Printful product update failed:", res.statusText);
|
||||
throw new Error("Failed to update Printful product");
|
||||
console.error("Printful product get failed:", await res.json());
|
||||
throw new Error("Failed to get Printful product");
|
||||
}
|
||||
|
||||
const payload: Printful.Products.MetaDataSingle<Printful.Products.Product> = await res.json();
|
||||
@@ -60,11 +60,18 @@ export default class PrintfulService {
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
console.error("Printful product update failed:", res.statusText);
|
||||
console.error("Printful product update failed:", await res.json());
|
||||
throw new Error("Failed to update Printful product");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Util = class {
|
||||
static getVariantMainImage(syncVariant: Printful.Products.SyncVariant): string {
|
||||
const previewFile = syncVariant.files.find(f => f.type === "preview");
|
||||
return previewFile?.preview_url ?? syncVariant.product.image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const env = () => {
|
||||
|
||||
Reference in New Issue
Block a user