feat(news): Add news model

This commit is contained in:
Mrugesh Mohapatra
2018-07-31 00:28:36 +05:30
committed by mrugesh mohapatra
parent f46f06ccd6
commit eba910e939
7 changed files with 103 additions and 17 deletions

5
common/models/article.js Normal file
View File

@@ -0,0 +1,5 @@
'use strict';
module.exports = function(Article) {
};

View File

@@ -0,0 +1,74 @@
{
"name": "article",
"plural": "articles",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"shortId": {
"type": "string",
"required": true
},
"title": {
"type": "string",
"required": true
},
"author": {
"type": "string",
"required": true
},
"subtitle": {
"type": "string"
},
"featureImage": {
"type": "string"
},
"draft": {
"type": "string",
"required": true
},
"renderableContent": {
"type": "string"
},
"published": {
"type": "boolean",
"required": true,
"default": false
},
"featured": {
"type": "boolean",
"required": true,
"default": false
},
"underReview": {
"type": "boolean",
"required": true,
"default": false
},
"viewCount": {
"type": "number",
"required": true,
"default": 1
},
"createdDate": {
"type": "date",
"required": true
},
"lastEditedDate": {
"type": "date",
"required": true
},
"history": {
"type": [
"object"
],
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}

View File

@@ -92,7 +92,7 @@
"type": "array",
"default": []
},
"guideUrl" : {
"guideUrl": {
"type": "string",
"description": "Used to link to an article in the FCC guide"
},

View File

@@ -244,19 +244,23 @@
},
"default": {}
},
"donationEmails": [ "string" ],
"donationEmails": {
"type": [
"string"
]
},
"isDonating": {
"type": "boolean",
"default": false,
"description": "Does the camper have an active donation"
"description": "Does the camper have an active donation",
"default": false
}
},
"validations": [],
"relations": {
"donations": {
"type": "hasMany",
"modal": "donation",
"foreignKey": ""
"foreignKey": "",
"modal": "donation"
},
"credentials": {
"type": "hasMany",