Merge branch 'reminder-select-btns-value' of MyFit/users-myfit into master
This commit is contained in:
@@ -35,8 +35,8 @@ export default function AddEditReminder({ className }) {
|
||||
'member_id': localStorage.getItem('member_id'),
|
||||
description: location.state?.reminder.description || '',
|
||||
note: location.state?.reminder.note || '',
|
||||
category: location.state?.reminder.category || '',
|
||||
mode: location.state?.reminder.mode || '',
|
||||
category: location.state?.reminder.code || '',
|
||||
mode: location.state?.reminder.code || '',
|
||||
'start_date': location.state? new Date(location.state?.reminder.start_date) : startDate,
|
||||
'end_date': location.state? new Date(location.state?.reminder.end_date) : endDate
|
||||
})
|
||||
@@ -47,7 +47,6 @@ export default function AddEditReminder({ className }) {
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
const getUserMode = async () => {
|
||||
try {
|
||||
const res = await api.getUserModeCategory('remmode');
|
||||
@@ -85,19 +84,21 @@ export default function AddEditReminder({ className }) {
|
||||
const res = await api.addReminder(reminder);
|
||||
if(res && res.status == 200){
|
||||
setSuccess(false)
|
||||
setMessage({status: true, message: 'Reminder successfully'})
|
||||
setMessage({status: true, message: 'Reminder set successfully'})
|
||||
setTimeout(()=>{
|
||||
navigate('/reminders', {replace: true})
|
||||
}, 2000)
|
||||
return
|
||||
}
|
||||
setSuccess(false)
|
||||
setMessage({status: false, message: `Opps, couldn't perform action`})
|
||||
setMessage({status: false, message: `Sorry, couldn't perform action`})
|
||||
} catch (error) {
|
||||
setSuccess(false)
|
||||
setMessage({status: false, message: 'An error occurred'})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getUserMode();
|
||||
@@ -144,7 +145,7 @@ export default function AddEditReminder({ className }) {
|
||||
{category.length > 0 &&
|
||||
<>
|
||||
{category.map((option, index)=>(
|
||||
<option key={index} className='' value={option.category}>{option.category}</option>
|
||||
<option key={index} className='' value={option.code}>{option.category}</option>
|
||||
))
|
||||
}
|
||||
</>
|
||||
@@ -165,7 +166,7 @@ export default function AddEditReminder({ className }) {
|
||||
{category.length > 0 &&
|
||||
<>
|
||||
{mode.map((option, index)=>(
|
||||
<option key={index} className='' value={option.mode}>{option.mode}</option>
|
||||
<option key={index} className='' value={option.code}>{option.mode}</option>
|
||||
))
|
||||
}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user