@dascompany/product 4.0.6 → 4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import ProductI from "../types/ProductI";
2
2
  export default class AccountCartReader {
3
- static getAll(accountId: string, productId: string): Promise<ProductI[]>;
3
+ static getAll(accountId: string): Promise<ProductI[]>;
4
4
  private static correctAccountCart;
5
5
  }
@@ -2,8 +2,8 @@ import DatabaseConnection from "../DatabaseConnection";
2
2
  import createQueryOptionsForId from "../utils/createQueryOptionsForId";
3
3
  import ProductReader from "./ProductReader";
4
4
  export default class AccountCartReader {
5
- static async getAll(accountId, productId) {
6
- const accountCart = await DatabaseConnection.getInstance().accountCart.selectAll(accountId, productId);
5
+ static async getAll(accountId) {
6
+ const accountCart = await DatabaseConnection.getInstance().accountCart.selectAll(accountId);
7
7
  return this.correctAccountCart(accountCart);
8
8
  }
9
9
  static async correctAccountCart(accountCart) {
@@ -1,7 +1,7 @@
1
1
  import { Table } from '@dascompany/database';
2
2
  import AccountCartRow from '../../types/rows/AccountCartRow';
3
3
  export default class AccountCartTable extends Table {
4
- selectAll(accountId: string, productId: string): Promise<AccountCartRow[]>;
4
+ selectAll(accountId: string): Promise<AccountCartRow[]>;
5
5
  delete(accountId: string, productId: string): Promise<void>;
6
6
  insert(accountId: string, productId: string): Promise<void>;
7
7
  private bindParams;
@@ -1,9 +1,9 @@
1
1
  import { Table } from '@dascompany/database';
2
2
  import * as SQL from '../../SQL.json';
3
3
  export default class AccountCartTable extends Table {
4
- async selectAll(accountId, productId) {
4
+ async selectAll(accountId) {
5
5
  const query = this.createQuery(SQL.accountCart.select);
6
- this.bindParams(query, accountId, productId);
6
+ query.bindParameter('account_id', accountId);
7
7
  const result = await query.execute();
8
8
  return result.getRows();
9
9
  }
@@ -18,7 +18,6 @@ export default class AccountCartTable extends Table {
18
18
  await query.execute();
19
19
  }
20
20
  bindParams(query, accountId, productId) {
21
- console.log(query, accountId, productId);
22
21
  query.bindParameter('account_id', accountId);
23
22
  query.bindParameter('product_id', productId);
24
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",