Mise à jour de routes et models
This commit is contained in:
+10
-10
@@ -16,11 +16,11 @@ module.exports = (sequelize, DataTypes) => {
|
||||
}
|
||||
}
|
||||
Article.init({
|
||||
article_id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false },
|
||||
article_slug: { type: DataTypes.STRING, allowNull: false },
|
||||
article_title: { type: DataTypes.STRING, allowNull: false },
|
||||
article_description: { type: DataTypes.TEXT },
|
||||
article_body: { type: DataTypes.TEXT, allowNull: false }
|
||||
articleId: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false },
|
||||
slug: { type: DataTypes.STRING, allowNull: false },
|
||||
title: { type: DataTypes.STRING, allowNull: false },
|
||||
description: { type: DataTypes.TEXT },
|
||||
body: { type: DataTypes.TEXT, allowNull: false }
|
||||
}, {
|
||||
sequelize,
|
||||
timestamps: false,
|
||||
@@ -36,11 +36,11 @@ module.exports = (sequelize, DataTypes) => {
|
||||
|
||||
Article.prototype.toJSONFor = function () {
|
||||
return {
|
||||
id: this.article_id,
|
||||
slug: this.article_slug,
|
||||
title: this.article_title,
|
||||
description: this.article_description,
|
||||
body: this.article_body
|
||||
articleId: this.articleId,
|
||||
slug: this.slug,
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
body: this.body
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user