From 0d36992a5c569584762e302a623ba3587b383e3d Mon Sep 17 00:00:00 2001 From: adhiraj23zelthy Date: Thu, 24 Oct 2024 19:18:20 +0530 Subject: [PATCH] fix: template zip file --- .../Modals/LaunchNewAppModal/LaunchNewAppForm.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/platform/components/Modals/LaunchNewAppModal/LaunchNewAppForm.jsx b/frontend/src/pages/platform/components/Modals/LaunchNewAppModal/LaunchNewAppForm.jsx index dfa2b2f4..53fc4723 100644 --- a/frontend/src/pages/platform/components/Modals/LaunchNewAppModal/LaunchNewAppForm.jsx +++ b/frontend/src/pages/platform/components/Modals/LaunchNewAppModal/LaunchNewAppForm.jsx @@ -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; }