mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
refactor(FE): Increase file upload limit to 5 MB
This commit is contained in:
@@ -24,9 +24,9 @@ type UniformityFormSchemaType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const FileSchema = Yup.mixed<File>()
|
const FileSchema = Yup.mixed<File>()
|
||||||
.test('documentSize', 'Ukuran file maksimal 2 MB', (value): boolean => {
|
.test('documentSize', 'Ukuran file maksimal 5 MB', (value): boolean => {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
if (value instanceof File) return value.size <= 2 * 1024 * 1024;
|
if (value instanceof File) return value.size <= 5 * 1024 * 1024;
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
.test('documentType', 'Format file harus Excel', (value): boolean => {
|
.test('documentType', 'Format file harus Excel', (value): boolean => {
|
||||||
|
|||||||
@@ -358,8 +358,8 @@ const UniformityForm = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.size > 2 * 1024 * 1024) {
|
if (document.size > 5 * 1024 * 1024) {
|
||||||
toast.error(`Ukuran file ${document.name} maksimal 2 MB!`);
|
toast.error(`Ukuran file ${document.name} maksimal 5 MB!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user