Skip to content

Commit

Permalink
fix: template zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
adhiraj23zelthy committed Oct 24, 2024
1 parent 4e197da commit 0d36992
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ const LaunchNewAppForm = ({ closeModal }) => {
let validationSchema = Yup.object().shape({
name: Yup.string(),
description: Yup.string(),
app_template: Yup.mixed(),
}).test('custom', null, function(value) {
app_template: Yup.mixed().test('fileType', 'Only ZIP files are allowed', (value) => {
if (value) {
const fileType = value.type;
return fileType === 'application/zip' || fileType === 'application/x-zip-compressed';
}
return true;
}),
}).test('custom', null, function(value) {
if (value.app_template) {
return true;
}
Expand Down

0 comments on commit 0d36992

Please sign in to comment.