Move error message to translation

This commit is contained in:
Jim LAURIE 2019-03-08 14:56:09 +01:00
parent 28506035cf
commit 0071d28f22
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@
"PluginInputFile.link": "browse",
"PluginInputFile.loading": "Your files are being uploaded...",
"PluginInputFile.text": "Drag & drop your files into this area or {link} from a file to upload",
"Upload.status.empty": "Files are empty",
"Upload.status.disabled": "File upload is disabled",
"Upload.status.sizeLimit": "{file} file is bigger than limit size!",
"notification.config.success": "The settings has been updated",
"notification.delete.success": "The file has been deleted",
"notification.dropFile.success": "Your file has been uploaded",

View File

@ -27,7 +27,7 @@ module.exports = {
const { files = {} } = ctx.request.body.files;
if (_.isEmpty(files)) {
return ctx.badRequest(null, 'Files are empty');
return ctx.badRequest(null, ctx.request.admin ? [{ messages: [{ id: 'Upload.status.empty' }] }] : 'Files are empty');
}
// Transform stream files to buffer