mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
parent
70b359923f
commit
2cae064575
5 changed files with 6 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @description Centralised error handling for API requests.
|
* @description Centralized error handling for API requests.
|
||||||
* @param {Function} next
|
* @param {Function} next
|
||||||
* @returns {Function} handleErrorClosure
|
* @returns {Function} handleErrorClosure
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,7 +12,7 @@ const urlUtils = require('../../../shared/url-utils');
|
||||||
const events = require('../../../server/lib/common/events');
|
const events = require('../../../server/lib/common/events');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The url service class holds all instances in a centralised place.
|
* The url service class holds all instances in a centralized place.
|
||||||
* It's the public API you can talk to.
|
* It's the public API you can talk to.
|
||||||
* It will tell you if the url generation is in progress or not.
|
* It will tell you if the url generation is in progress or not.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,9 +13,9 @@ const events = require('../../../server/lib/common/events');
|
||||||
* This is a connector for url generator and resources.
|
* This is a connector for url generator and resources.
|
||||||
* Stores relative urls by default.
|
* Stores relative urls by default.
|
||||||
*
|
*
|
||||||
* We have to have a centralised place where we keep track of all urls, otherwise
|
* We have to have a centralized place where we keep track of all urls, otherwise
|
||||||
* we will never know if we generate the same url twice. Furthermore, it's easier
|
* we will never know if we generate the same url twice. Furthermore, it's easier
|
||||||
* to ask a centralised class instance if you want a url for a resource than
|
* to ask a centralized class instance if you want a url for a resource than
|
||||||
* iterating over all url generators and asking for it.
|
* iterating over all url generators and asking for it.
|
||||||
* You can easily ask `this.urls[resourceId]`.
|
* You can easily ask `this.urls[resourceId]`.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -129,7 +129,7 @@ module.exports = {
|
||||||
setting.value = JSON.stringify(setting.value);
|
setting.value = JSON.stringify(setting.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: handle these transformations in a centralised API place (these rules should apply for ALL resources)
|
// @TODO: handle these transformations in a centralized API place (these rules should apply for ALL resources)
|
||||||
|
|
||||||
// CASE: Ensure we won't forward strings, otherwise model events or model interactions can fail
|
// CASE: Ensure we won't forward strings, otherwise model events or model interactions can fail
|
||||||
if (settingType === 'boolean' && (setting.value === '0' || setting.value === '1')) {
|
if (settingType === 'boolean' && (setting.value === '0' || setting.value === '1')) {
|
||||||
|
|
|
@ -125,7 +125,7 @@ module.exports = {
|
||||||
setting.value = JSON.stringify(setting.value);
|
setting.value = JSON.stringify(setting.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: handle these transformations in a centralised API place (these rules should apply for ALL resources)
|
// @TODO: handle these transformations in a centralized API place (these rules should apply for ALL resources)
|
||||||
|
|
||||||
// CASE: Ensure we won't forward strings, otherwise model events or model interactions can fail
|
// CASE: Ensure we won't forward strings, otherwise model events or model interactions can fail
|
||||||
if (settingType === 'boolean' && (setting.value === '0' || setting.value === '1')) {
|
if (settingType === 'boolean' && (setting.value === '0' || setting.value === '1')) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue