0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

Fixed extra arguments being supplied to function calls

- identified by tsc, this shouldn't change any functionality because
  there were extra arguments being supplied and were unused
This commit is contained in:
Daniel Lockyer 2024-05-07 11:08:56 +02:00 committed by Daniel Lockyer
parent 29cc3003c7
commit 1fd155d56a
7 changed files with 10 additions and 10 deletions

View file

@ -5,7 +5,7 @@ const settingsCache = require('../../shared/settings-cache');
function getOgImage(data) {
const context = data.context ? data.context : null;
const contextObject = getContextObject(data, context, false);
const contextObject = getContextObject(data, context);
if (_.includes(context, 'home')) {
const imgUrl = settingsCache.get('og_image') || settingsCache.get('cover_image');

View file

@ -5,7 +5,7 @@ const settingsCache = require('../../shared/settings-cache');
function getTwitterImage(data) {
const context = data.context ? data.context : null;
const contextObject = getContextObject(data, context, false);
const contextObject = getContextObject(data, context);
if (_.includes(context, 'home')) {
const imgUrl = settingsCache.get('twitter_image') || settingsCache.get('cover_image');

View file

@ -144,8 +144,8 @@ const controller = {
}
},
permissions: true,
query(frame) {
return commentsService.controller.destroy(frame);
query() {
return commentsService.controller.destroy();
}
},

View file

@ -25,11 +25,11 @@ const forPost = (attrs, options) => {
}
if (relation === 'author' && attrs.author) {
attrs.author = forUser(attrs.author, options);
attrs.author = forUser(attrs.author);
}
if (relation === 'authors' && attrs.authors) {
attrs.authors = attrs.authors.map(author => forUser(author, options));
attrs.authors = attrs.authors.map(author => forUser(author));
}
});
}

View file

@ -144,7 +144,7 @@ const activityFeedMapper = (event, frame) => {
return clickEventMapper(event, frame);
}
if (event.type === 'aggregated_click_event') {
return aggregatedClickEventMapper(event, frame);
return aggregatedClickEventMapper(event);
}
if (event.type === 'feedback_event') {
return feedbackEventMapper(event, frame);

View file

@ -94,7 +94,7 @@ class Attribution {
}
// Fetch model
const model = await this.#urlTranslator.getResourceById(this.id, this.type, {absolute: true});
const model = await this.#urlTranslator.getResourceById(this.id, this.type);
return this.getResource(model);
}
}

View file

@ -7,7 +7,7 @@ const versionMismatchHandler = (APIVersionCompatibilityService) => {
* @param {import('express').Response} res
* @param {import('express').NextFunction} next
*/
return async function versionMismatchHandlerMiddlware(err, req, res, next) {
return async function versionMismatchHandlerMiddleware(err, req, res, next) {
if (err && err.errorType === 'RequestNotAcceptableError') {
if (err.code === 'UPDATE_CLIENT') {
const {key, type} = extractApiKey(req);
@ -24,7 +24,7 @@ const versionMismatchHandler = (APIVersionCompatibilityService) => {
}
}
next(err, req, res);
next(err);
};
};