refactor(FE-Storyless): remove console, window and err catch

This commit is contained in:
rstubryan
2025-11-27 13:46:53 +07:00
parent 4b6144d0b4
commit 7a76719547
4 changed files with 7 additions and 10 deletions
@@ -2924,8 +2924,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
}, 1000);
}
}
} catch (error) {
console.error('Error creating recording:', error);
} catch {
toast.error(
'Gagal membuat recording. Silakan coba lagi.'
);
@@ -173,8 +173,7 @@ const GradingForm = ({ type = 'add', initialValues }: GradingFormProps) => {
deleteModal.closeModal();
toast.success(res?.message || 'Successfully delete Grading!');
router.push('/production/recording');
} catch (err) {
console.error(err);
} catch {
setGradingFormErrorMessage('Failed to delete Grading');
} finally {
setIsDeleteLoading(false);
@@ -241,9 +241,8 @@ const PurchaseOrderStaffApprovalForm = ({
);
formik.setFieldValue('items', updatedPurchaseItems);
}
} catch (error) {
} catch {
toast.error('Terjadi kesalahan saat menghapus item pembelian');
console.error('Delete item error:', error);
}
}, [
initialValues?.id,
@@ -12,6 +12,7 @@ import {
pdf,
} from '@react-pdf/renderer';
import { Icon } from '@iconify/react';
import toast from 'react-hot-toast';
import Button from '@/components/Button';
import { Purchase } from '@/types/api/purchase/purchase';
@@ -251,7 +252,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
const handleDownloadPDF = async () => {
if (!purchaseData) {
alert('No purchase order data available');
toast.error('No purchase order data available');
return;
}
@@ -502,9 +503,8 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
} catch (error) {
console.error('Error generating PDF:', error);
alert('Failed to generate PDF. Please try again.');
} catch {
toast.error('Failed to generate PDF. Please try again.');
} finally {
setIsGeneratingPDF(false);
}