mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
ef98c65040
* Removed unused fields from v2 Content API - We want to ship the v2 Content API as clean and lean as we can - Many fields in the DB aren't actually used, we shouldn't return these values - Other values aren't useful outside of Admin clients, and shouldn't be returned either Fields removed: - tags: created_at, updated_at, parent - authors: locale, accessibility, tour - posts: locale, author status, page
27 lines
847 B
JavaScript
27 lines
847 B
JavaScript
function isPost(jsonData) {
|
|
return jsonData.hasOwnProperty('html') &&
|
|
jsonData.hasOwnProperty('title') && jsonData.hasOwnProperty('slug');
|
|
}
|
|
|
|
function isTag(jsonData) {
|
|
return jsonData.hasOwnProperty('name') && jsonData.hasOwnProperty('slug') &&
|
|
jsonData.hasOwnProperty('description') && jsonData.hasOwnProperty('feature_image');
|
|
}
|
|
|
|
function isUser(jsonData) {
|
|
return jsonData.hasOwnProperty('bio') && jsonData.hasOwnProperty('website') &&
|
|
jsonData.hasOwnProperty('profile_image') && jsonData.hasOwnProperty('location');
|
|
}
|
|
|
|
function isNav(jsonData) {
|
|
return jsonData.hasOwnProperty('label') && jsonData.hasOwnProperty('url') &&
|
|
jsonData.hasOwnProperty('slug') && jsonData.hasOwnProperty('current');
|
|
}
|
|
|
|
module.exports = {
|
|
isPost: isPost,
|
|
isTag: isTag,
|
|
isUser: isUser,
|
|
isNav: isNav
|
|
};
|