refatoração de frontend
parent
b3ac76e340
commit
7b1d2f2d2b
|
@ -95,12 +95,12 @@ const ConfigModal = ({ open, onClose, change }) => {
|
|||
try {
|
||||
const { data } = await api.get('/settings')
|
||||
|
||||
const outBusinessHours = data.config.find((c) => c.key == "outBusinessHours")
|
||||
const ticketExpiration = data.config.find((c) => c.key == "ticketExpiration")
|
||||
const saturday = data.config.find((c) => c.key == "saturday")
|
||||
const sunday = data.config.find((c) => c.key == "sunday")
|
||||
const weekend = data.config.find((c) => c.key == "weekend")
|
||||
const holiday = data.config.find((c) => c.key == "holiday")
|
||||
const outBusinessHours = data.config.find((c) => c.key === "outBusinessHours")
|
||||
const ticketExpiration = data.config.find((c) => c.key === "ticketExpiration")
|
||||
const saturday = data.config.find((c) => c.key === "saturday")
|
||||
const sunday = data.config.find((c) => c.key === "sunday")
|
||||
const weekend = data.config.find((c) => c.key === "weekend")
|
||||
const holiday = data.config.find((c) => c.key === "holiday")
|
||||
|
||||
setConfig({
|
||||
startTimeBus: outBusinessHours.startTime,
|
||||
|
@ -444,23 +444,6 @@ const ConfigModal = ({ open, onClose, change }) => {
|
|||
|
||||
|
||||
|
||||
const TimePickerField = ({ field, form, ...other }) => {
|
||||
const { name, value } = field
|
||||
|
||||
const handleChange = (time) => {
|
||||
form.setFieldValue(name, time, true)
|
||||
}
|
||||
|
||||
return (
|
||||
<TimePicker
|
||||
{...other}
|
||||
name={name}
|
||||
value={value}
|
||||
onChange={handleChange}
|
||||
format="hh:mm a"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default React.memo(ConfigModal)
|
||||
|
|
Loading…
Reference in New Issue