mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 04:10:33 +03:00
19167c1af2
closes #9101
With 506a0c3e9e
we don't expose the `status` field for author context anymore, which is used to determine the correct URL for the `{{url}}` helper in https://github.com/TryGhost/Ghost/blob/master/core/server/data/schema/checks.js#L13
This fix uses the field `profile_image` instead and adds a missing test for author context to the `{{url}}` helper test.
27 lines
840 B
JavaScript
27 lines
840 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('parent');
|
|
}
|
|
|
|
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
|
|
};
|