mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Refactored storagePath parameter
refs https://github.com/TryGhost/Team/issues/916 - The refactor was done follow the DI Constructor pattern with single options Object parameter - It didn't make sense to have a "config" object inside of options object containing just one property
This commit is contained in:
parent
2472695535
commit
19c5c0b05a
@ -15,8 +15,7 @@ const messages = {
|
||||
module.exports = class MembersCSVImporter {
|
||||
/**
|
||||
* @param {Object} options
|
||||
* @param {Object} options.config
|
||||
* @param {string} options.config.storagePath - The path to store CSV's in before importing
|
||||
* @param {string} options.storagePath - The path to store CSV's in before importing
|
||||
* @param {Object} options.settingsCache - An instance of the Ghost Settings Cache
|
||||
* @param {() => Object} options.getMembersApi
|
||||
* @param {Object} options.ghostMailer - An instance of GhostMailer
|
||||
@ -25,8 +24,8 @@ module.exports = class MembersCSVImporter {
|
||||
* @param {Object} options.knex - An instance of the Ghost Database connection
|
||||
* @param {Function} options.urlFor - function generating urls
|
||||
*/
|
||||
constructor({config, settingsCache, getMembersApi, ghostMailer, isSet, addJob, knex, urlFor}) {
|
||||
this._storagePath = config.storagePath;
|
||||
constructor({storagePath, settingsCache, getMembersApi, ghostMailer, isSet, addJob, knex, urlFor}) {
|
||||
this._storagePath = storagePath;
|
||||
this._settingsCache = settingsCache;
|
||||
this._getMembersApi = getMembersApi;
|
||||
this._ghostMailer = ghostMailer;
|
||||
|
@ -128,9 +128,7 @@ const membersService = {
|
||||
stripeConnect: require('./stripe-connect'),
|
||||
|
||||
importer: new MembersCSVImporter({
|
||||
config: {
|
||||
storagePath: config.getContentPath('data')
|
||||
},
|
||||
storagePath: config.getContentPath('data'),
|
||||
settingsCache,
|
||||
getMembersApi: () => membersApi,
|
||||
ghostMailer,
|
||||
|
Loading…
Reference in New Issue
Block a user