refactor: 소스 정리

main
minuk926 3 years ago
parent f00a0dd3f4
commit 4c412b0a1e

@ -93,16 +93,16 @@ const PublicBoard = () => {
const submitPublicBoard = (type, payload) => {
switch (type) {
case 'SAVE':
savePublicBoard(payload); // .then((res) => {
search();
setOpen(false);
// });
savePublicBoard(payload).then(() => {
search();
setOpen(false);
}); // .then((res) => {
break;
case 'DELETE':
deletePublicBoard(payload); // .then((res) => {
// search();
setOpen(false);
// });
deletePublicBoard(payload).then(() => {
search();
setOpen(false);
}); // .then((res) => {
break;
default:
}

@ -21,12 +21,12 @@ const PublicBoardForm = (props) => {
const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props;
const alert = useAlert();
const quillRef = useRef();
const [dept, setDept] = useState(inDept);
const [subject, setSubject] = useState(inTitle);
const [contents, setContents] = useState(inContents);
const [dept, setDept] = useState(inDept || '주정차위반');
const [subject, setSubject] = useState(inTitle || '');
const [contents, setContents] = useState(inContents || '');
const [filesInfo, setFilesInfo] = useState();
const [selectedFile, setSelectedFile] = useState(inFilename); //
const [fileData, setFileData] = useState();
const [selectedFile, setSelectedFile] = useState(inFilename || ''); //
// const [fileData, setFileData] = useState();
const onList = () => {
setOpen(false);
@ -131,26 +131,17 @@ const PublicBoardForm = (props) => {
<TextField required label="제목" value={subject} onChange={(e) => setSubject(e.target.value)} fullWidth />
</Grid>
<Grid item xs={12} sm={6}>
<Select
disabled={!create}
label="업무구분"
required
id="inDept"
name="inDept"
defaultValue={dept || '주정차위반'}
onChange={(e) => setDept(e.target.value)}
fullWidth
>
<MenuItem key="1" value="주정차위반">
주정차위반
</MenuItem>
<MenuItem key="2" value="장애인위반">
장애인위반
</MenuItem>
<MenuItem key="3" value="기타">
기타
</MenuItem>
{/* <FormControl variant="filled" sx={{ m:1, minWidth: 120 }}> */}
{/* <InputLabel id="demo-simple-select-filled-label">Age</InputLabel> */}
<Select disabled={!create} label="업무구분" required value={dept} onChange={(e) => setDept(e.target.value)} fullWidth>
{/* <MenuItem value=""> */}
{/* <em>None</em> */}
{/* </MenuItem> */}
<MenuItem value="주정차위반">주정차위반</MenuItem>
<MenuItem value="장애인위반">장애인위반</MenuItem>
<MenuItem value="기타">기타</MenuItem>
</Select>
{/* </FormControl> */}
</Grid>
<Grid item xs={12} sm={6}>
<TextField disabled label="등록일" value={inNalja} fullWidth />
@ -168,7 +159,7 @@ const PublicBoardForm = (props) => {
<Grid>
<TextField
// label=""
value={selectedFile || ''}
value={selectedFile}
// inputProps={{ display: 'none' }}
fullWidth
// InputProps={{

Loading…
Cancel
Save