Skip to content

Commit

Permalink
fix: add image to product edit (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorDePaula authored Feb 4, 2023
1 parent 0c5f081 commit 426c5e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/catalog/functions/editProduct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { editProduct as EditProduct } from '../../whatsapp/functions';
export interface editProductParams {
name?: string;
description?: string;
image?: string;
price?: number;
isHidden?: boolean;
url?: string;
Expand All @@ -44,11 +45,11 @@ export async function editProduct(
): Promise<ProductModel> {
const produto = await assertGetProduct(productId);
produto.name = params.name;
produto.imageCdnUrl = params.image;
produto.description = params.description;
produto.priceAmount1000 = params.price;
produto.isHidden = params.isHidden;
produto.url = params.url;
produto.retailerId = params.retailerId;

return await EditProduct(produto);
}
4 changes: 3 additions & 1 deletion src/whatsapp/models/ProductModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ interface Derived {}
* @whatsapp 509468 >= 2.2222.8
*/
export declare interface ProductModel
extends ModelProxy<Props, Session, Derived> {}
extends ModelProxy<Props, Session, Derived> {
image: string | undefined;
}

/** @whatsapp 9468
* @whatsapp 509468 >= 2.2222.8
Expand Down

0 comments on commit 426c5e9

Please sign in to comment.