improve error on theme upload, add gif to allowed uploads
This commit is contained in:
parent
851876acfa
commit
2a5a01af2e
|
@ -16,7 +16,7 @@ class Admin::ThemesController < Admin::AdminController
|
|||
filename = params[:file]&.original_filename || File.basename(path)
|
||||
upload = UploadCreator.new(file, filename, for_theme: true).create_for(current_user.id)
|
||||
if upload.errors.count > 0
|
||||
render json: upload.errors, status: :unprocessable_entity
|
||||
render_json_error upload
|
||||
else
|
||||
render json: { upload_id: upload.id }, status: :created
|
||||
end
|
||||
|
|
|
@ -714,7 +714,7 @@ files:
|
|||
min: 5
|
||||
max: 150
|
||||
theme_authorized_extensions:
|
||||
default: 'jpg|jpeg|png|woff|woff2|svg|eot|ttf|otf'
|
||||
default: 'jpg|jpeg|png|woff|woff2|svg|eot|ttf|otf|gif'
|
||||
type: list
|
||||
authorized_extensions:
|
||||
client: true
|
||||
|
|
Loading…
Reference in New Issue