0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Improved logs for slow get helper

no issue

- Updated the logs to show something more useful - controller name, instead of current [object Ojbect] appearing in the log
This commit is contained in:
Nazar Gargol 2020-01-07 11:25:51 +01:00
parent c701293514
commit cb68257952

View file

@ -140,7 +140,8 @@ get = function get(resource, options) {
return Promise.resolve(options.inverse(self, {data: data}));
}
const controller = api[apiVersion][RESOURCES[resource].alias];
const controllerName = RESOURCES[resource].alias;
const controller = api[apiVersion][controllerName];
const action = isBrowse(apiOptions) ? 'browse' : 'read';
// Parse the options we're going to pass to the API
@ -179,7 +180,7 @@ get = function get(resource, options) {
message: `{{#get}} helper took ${totalMs}ms to complete`,
code: 'SLOW_GET_HELPER',
errorDetails: {
api: `${apiVersion}.${controller}.${action}`,
api: `${apiVersion}.${controllerName}.${action}`,
apiOptions,
returnedRows: returnedRowsCount
}