feat: remove section name handling from DetailPlantSection and ListPlantSection components

This commit is contained in:
2025-10-17 11:13:05 +07:00
parent f049902d2c
commit c7c5a33613
2 changed files with 7 additions and 42 deletions

View File

@@ -10,7 +10,6 @@ const DetailPlantSection = (props) => {
const defaultData = {
plant_section_id: '',
plantName: '',
sectionName: '',
status: true,
};
@@ -34,19 +33,8 @@ const DetailPlantSection = (props) => {
return;
}
if (!FormData.sectionName) {
NotifOk({
icon: 'warning',
title: 'Peringatan',
message: 'Kolom Section Name Tidak Boleh Kosong',
});
setConfirmLoading(false);
return;
}
const payload = {
plantName: FormData.plantName,
sectionName: FormData.sectionName,
status: FormData.status,
};
@@ -57,7 +45,6 @@ const DetailPlantSection = (props) => {
statusCode: FormData.plant_section_id ? 200 : 201,
data: {
plantName: FormData.plantName,
sectionName: FormData.sectionName,
},
};
@@ -67,7 +54,7 @@ const DetailPlantSection = (props) => {
title: 'Berhasil',
message: `Data Plant Section "${
response.data?.plantName || FormData.plantName
} - ${response.data?.sectionName || FormData.sectionName}" berhasil ${FormData.plant_section_id ? 'diubah' : 'ditambahkan'}.`,
}" berhasil ${FormData.plant_section_id ? 'diubah' : 'ditambahkan'}.`,
});
props.setActionMode('list');
@@ -120,7 +107,7 @@ const DetailPlantSection = (props) => {
return (
<Modal
title={`${
title={`${
props.actionMode === 'add'
? 'Tambah'
: props.actionMode === 'preview'
@@ -222,17 +209,6 @@ const DetailPlantSection = (props) => {
readOnly={props.readOnly}
/>
</div>
<div style={{ marginBottom: 12 }}>
<Text strong>Section Name</Text>
<Text style={{ color: 'red' }}> *</Text>
<Input
name="sectionName"
value={FormData.sectionName}
onChange={handleInputChange}
placeholder="Enter Section Name"
readOnly={props.readOnly}
/>
</div>
</div>
)}
</Modal>