Replaces MongoDB support with PostgreSQL (#151)
- All schemas have been rewritten to a relational model - All services have been rewritten to accommodate the new data model - Adds idempotency keys to core endpoints allowing you to retry requests with no additional side effects - Adds staged jobs to avoid putting jobs in the queue when transactions abort - Adds atomic transactions to all methods with access to the data layer Co-authored-by: Oliver Windall Juhl <oliver@mrbltech.com>
This commit is contained in:
1 parent
5f819486fc
commit
f1baca3cbd
499 files changed
+25909
-16128
No files matched your search
@@ -39,16 +39,7 @@ class AddOnService extends BaseService {
|
||||
* @return {string} the validated id
|
||||
*/
|
||||
validateId_(rawId) {
|
||||
const schema = Validator.objectId()
|
||||
const { value, error } = schema.validate(rawId.toString())
|
||||
if (error) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.INVALID_ARGUMENT,
|
||||
"The addOnId could not be casted to an ObjectId"
|
||||
)
|
||||
}
|
||||
|
||||
return value
|
||||
return rawId
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +178,7 @@ class AddOnService extends BaseService {
|
||||
})
|
||||
|
||||
// Return the price if we found a suitable match
|
||||
if (price) {
|
||||
if (price !== undefined) {
|
||||
return price
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user