mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
🎨 Theme events (#7269)
no issue - add events for uploaded, downloaded & deleted
This commit is contained in:
parent
b7c0c65d56
commit
84a35a4753
@ -6,6 +6,7 @@ var Promise = require('bluebird'),
|
||||
fs = require('fs-extra'),
|
||||
config = require('../config'),
|
||||
errors = require('../errors'),
|
||||
events = require('../events'),
|
||||
storage = require('../storage'),
|
||||
settings = require('./settings'),
|
||||
utils = require('./utils'),
|
||||
@ -62,6 +63,7 @@ themes = {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
events.emit('theme.uploaded', zip.shortName);
|
||||
// store extracted theme
|
||||
return storageAdapter.save({
|
||||
name: zip.shortName,
|
||||
@ -113,6 +115,7 @@ themes = {
|
||||
|
||||
return utils.handlePermissions('themes', 'read')(options)
|
||||
.then(function () {
|
||||
events.emit('theme.downloaded', themeName);
|
||||
return storageAdapter.serve({isTheme: true, name: themeName});
|
||||
});
|
||||
},
|
||||
@ -138,6 +141,7 @@ themes = {
|
||||
throw new errors.NotFoundError(i18n.t('errors.api.themes.themeDoesNotExist'));
|
||||
}
|
||||
|
||||
events.emit('theme.deleted', name);
|
||||
return storageAdapter.delete(name, config.paths.themePath);
|
||||
})
|
||||
.then(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user