Makes ProductVariant operations go through ProductService (#68)

Ensures that we can reliably manage product variants and their relationship to products
This commit is contained in:
Sebastian Rindom
2020-05-28 11:44:11 +02:00
committed by GitHub
parent ad4f9479ea
commit 706ca8ac45
81 changed files with 975 additions and 1005 deletions
+10 -4
View File
@@ -1,15 +1,21 @@
import mongoose from "mongoose"
String.prototype.equals = function(that) {
return this === that
}
class IdMap {
ids = {}
getId(key) {
getId(key, backend=false) {
if (this.ids[key]) {
return this.ids[key]
}
const id = `${mongoose.Types.ObjectId()}`
this.ids[key] = id
return id
const mongooseId = `${mongoose.Types.ObjectId()}`
this.ids[key] = mongooseId
return mongooseId
}
}