diff --git a/packages/medusa-core-utils/src/errors.js b/packages/medusa-core-utils/src/errors.js index f5a99fd548..eae11818fc 100644 --- a/packages/medusa-core-utils/src/errors.js +++ b/packages/medusa-core-utils/src/errors.js @@ -7,7 +7,8 @@ export const MedusaErrorTypes = { DB_ERROR: "database_error", INVALID_ARGUMENT: "invalid_argument", INVALID_DATA: "invalid_data", - NOT_FOUND: "not_found" + NOT_FOUND: "not_found", + NOT_ALLOWED: "not_allowed" } /** diff --git a/packages/medusa/src/models/customer.js b/packages/medusa/src/models/customer.js index 349d836c7d..8aa7774161 100644 --- a/packages/medusa/src/models/customer.js +++ b/packages/medusa/src/models/customer.js @@ -13,7 +13,7 @@ class CustomerModel extends BaseModel { email: { type: String, required: true, unique: true }, first_name: { type: String, required: true }, last_name: { type: String, required: true }, - billingAddress: { type: AddressSchema }, + billing_address: { type: AddressSchema }, password_hash: { type: String }, metadata: { type: mongoose.Schema.Types.Mixed, default: {} }, } diff --git a/packages/medusa/src/services/cart.js b/packages/medusa/src/services/cart.js index 19355481a7..b206f4eb63 100644 --- a/packages/medusa/src/services/cart.js +++ b/packages/medusa/src/services/cart.js @@ -172,7 +172,10 @@ class CartService extends BaseService { } /** - * + * Adds a line item to the cart. + * @param {string} cartId - the id of the cart that we will add to + * @param {LineItem} lineItem - the line item to add. + * @retur {Promise} the result of the update operation */ async addLineItem(cartId, lineItem) { const validatedLineItem = this.validateLineItem_(lineItem)