@ozdao/prometheus-framework 0.2.5 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -688,12 +688,18 @@ var reaction_model = (mongoose) => {
688
688
  },
689
689
  type: {
690
690
  type: String,
691
- enum: ["event", "comment", "blogpost"],
691
+ enum: ["event", "comment", "blogpost", "mix"],
692
692
  default: "blogpost",
693
693
  required: true
694
694
  },
695
695
  target: {
696
- type: mongoose.Schema.Types.ObjectId,
696
+ type: function(value) {
697
+ if (this.type !== "mix") {
698
+ return mongoose.Schema.Types.ObjectId;
699
+ } else {
700
+ return String;
701
+ }
702
+ },
697
703
  ref: function(value) {
698
704
  if (this.owner.type === "event")
699
705
  return "Event";
@@ -687,12 +687,18 @@ var reaction_model = (mongoose) => {
687
687
  },
688
688
  type: {
689
689
  type: String,
690
- enum: ["event", "comment", "blogpost"],
690
+ enum: ["event", "comment", "blogpost", "mix"],
691
691
  default: "blogpost",
692
692
  required: true
693
693
  },
694
694
  target: {
695
- type: mongoose.Schema.Types.ObjectId,
695
+ type: function(value) {
696
+ if (this.type !== "mix") {
697
+ return mongoose.Schema.Types.ObjectId;
698
+ } else {
699
+ return String;
700
+ }
701
+ },
696
702
  ref: function(value) {
697
703
  if (this.owner.type === "event")
698
704
  return "Event";