agrs-sequelize-sdk 1.1.62 → 1.1.64

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.
package/models/Ad.js CHANGED
@@ -170,9 +170,20 @@ module.exports = (sequelize, DataTypes) => {
170
170
  };
171
171
  }
172
172
 
173
+ // do the same with RSOCFeedCampaign
174
+ const rsocFeedCampaign = await sequelize.models.RSOCFeedCampaign.findOne({
175
+ where: { AGRS_CID: this.AGRS_CID },
176
+ });
177
+
178
+ if (rsocFeedCampaign) {
179
+ return {
180
+ type: "RSOCFeedCampaign",
181
+ data: rsocFeedCampaign,
182
+ };
183
+ }
173
184
  return null;
174
185
  };
175
-
186
+
176
187
  Ad.addHook("afterCreate", async (ad, options) => {
177
188
  if (ad.publish === false) {
178
189
  // If publish is false on creation, save a snapshot to AdHistory
@@ -182,7 +193,7 @@ module.exports = (sequelize, DataTypes) => {
182
193
  });
183
194
  }
184
195
  });
185
-
196
+
186
197
  Ad.addHook("beforeUpdate", async (ad, options) => {
187
198
  if (ad.changed("publish")) {
188
199
  if (ad.previous("publish") === true && ad.publish === false) {
package/models/Article.js CHANGED
@@ -103,6 +103,10 @@ module.exports = (sequelize, DataTypes) => {
103
103
  type: DataTypes.STRING,
104
104
  allowNull: true,
105
105
  },
106
+ name: {
107
+ type: DataTypes.STRING,
108
+ allowNull: true,
109
+ },
106
110
  },
107
111
  {
108
112
  tableName: "articles",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.1.62",
3
+ "version": "1.1.64",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",