FEATURE: prototype of local theme directory watcher

(note this will be documented a bit late)
This commit is contained in:
Sam
2018-03-12 18:36:06 +11:00
parent 74ce2220a7
commit 758b9a7dda
6 changed files with 216 additions and 10 deletions

View File

@@ -82,6 +82,13 @@ class Admin::ThemesController < Admin::AdminController
rescue RuntimeError
render_json_error I18n.t('themes.error_importing')
end
elsif params[:bundle]
begin
@theme = RemoteTheme.update_tgz_theme(params[:bundle].path, user: current_user)
render json: @theme, status: :created
rescue RuntimeError
render_json_error I18n.t('themes.error_importing')
end
else
render json: @theme.errors, status: :unprocessable_entity
end