Skip to content

Commit

Permalink
mearged
Browse files Browse the repository at this point in the history
  • Loading branch information
amit548 committed Mar 15, 2022
1 parent 41a9122 commit 48c249e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions src/controllers/admin/product.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getEditProduct = async (req: Request, res: Response) => {
export const postAddProduct = async (req: Request, res: Response) => {
const productInput = plainToInstance(ProductDto, {
...req.body,
group: '622a00966a1a8eadda16cebb',
group: '622a00966a1a8eadda16cebb', // TODO: remove hardcoded id
});

const errors = await validate(productInput);
Expand Down Expand Up @@ -107,7 +107,6 @@ export const postEditProduct = async (req: Request, res: Response) => {

export const deleteProduct = async (req: Request, res: Response) => {
const id = req.body.productId;
console.log(`id: ${id}`);

if (!isValidObjectId(id)) {
req.flash('error', 'Product not found');
Expand Down
2 changes: 0 additions & 2 deletions src/core/api/product.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class ProductApi {
}

static async deleteProduct(id: string): Promise<Product> {
console.log('deleteProduct', id);

return await productsModel.findByIdAndDelete(id).lean();
}

Expand Down

0 comments on commit 48c249e

Please sign in to comment.