forked from geolba/tethys.backend
- daraggable crators and contributors inside Pages/Submitter/Dataset/Create.Vue
- typescript and prettier updates - FileUpload component with dark mode and dragable uploads - comment FontFamily in tailwind.config.js
This commit is contained in:
parent
f76a92da2c
commit
c4f4eff0d9
18 changed files with 1138 additions and 951 deletions
|
@ -274,19 +274,27 @@ export default class DatasetController {
|
|||
language: schema.string({ trim: true }, [rules.minLength(2), rules.maxLength(255)]),
|
||||
}),
|
||||
),
|
||||
file: schema.file({
|
||||
size: '100mb',
|
||||
extnames: ['jpg', 'gif', 'png'],
|
||||
}),
|
||||
upload: schema.object().members({
|
||||
label: schema.string({ trim: true }, [rules.maxLength(255)]),
|
||||
// file: schema.file({
|
||||
// size: '100mb',
|
||||
// extnames: ['jpg', 'gif', 'png'],
|
||||
// }),
|
||||
files: schema.array([rules.minLength(1)]).members(
|
||||
schema.file({
|
||||
size: '100mb',
|
||||
extnames: ['jpg', 'gif', 'png'],
|
||||
}),
|
||||
),
|
||||
// upload: schema.object().members({
|
||||
// label: schema.string({ trim: true }, [rules.maxLength(255)]),
|
||||
|
||||
// label: schema.string({ trim: true }, [
|
||||
// // rules.minLength(3),
|
||||
// // rules.maxLength(255),
|
||||
// ]),
|
||||
}),
|
||||
// // label: schema.string({ trim: true }, [
|
||||
// // // rules.minLength(3),
|
||||
// // // rules.maxLength(255),
|
||||
// // ]),
|
||||
// }),
|
||||
});
|
||||
|
||||
// const coverImages = request.file('files');
|
||||
// node ace make:validator CreateUser
|
||||
try {
|
||||
// Step 2 - Validate request body against the schema
|
||||
|
@ -298,23 +306,25 @@ export default class DatasetController {
|
|||
// return response.badRequest(error.messages);
|
||||
throw error;
|
||||
}
|
||||
const coverImage = request.file('file');
|
||||
const coverImage = request.files('files')[0];
|
||||
if (coverImage) {
|
||||
|
||||
// clientName: 'Gehaltsschema.png'
|
||||
// clientName: 'Gehaltsschema.png'
|
||||
// extname: 'png'
|
||||
// fieldName: 'file'
|
||||
// fieldName: 'file'
|
||||
// size: 135624
|
||||
|
||||
//const datasetFolder = 'files/' . dataset->id;
|
||||
|
||||
// await coverImage.moveToDisk('./')
|
||||
await coverImage.moveToDisk('/test_dataset', {
|
||||
name: 'renamed-file-name.jpg',
|
||||
overwrite: true, // overwrite in case of conflict
|
||||
},'local');
|
||||
await coverImage.moveToDisk(
|
||||
'/test_dataset2',
|
||||
{
|
||||
name: 'renamed-file-name.jpg',
|
||||
overwrite: true, // overwrite in case of conflict
|
||||
},
|
||||
'local',
|
||||
);
|
||||
// let path = coverImage.filePath;
|
||||
|
||||
}
|
||||
// const user = await User.create(input);
|
||||
// if (request.input('roles')) {
|
||||
|
@ -362,7 +372,7 @@ export default class DatasetController {
|
|||
'subjects.*.type.required': 'keyword type is required',
|
||||
'subjects.*.language.required': 'language of keyword is required',
|
||||
|
||||
'file.size': 'file size is to big',
|
||||
'file.extnames': 'file extension is not supported',
|
||||
'files.*.size': 'file size is to big',
|
||||
'files.extnames': 'file extension is not supported',
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue