File tree Expand file tree Collapse file tree 6 files changed +10
-10
lines changed
Expand file tree Collapse file tree 6 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ interface MedicationContextType {
55 loading : boolean ;
66 medications : Medication [ ] ;
77 addMedication : ( newMedication : CreateMedication ) => void ;
8- modifyMedication : ( id : number , oldmedication : PatchMedication ) => void ;
8+ modifyMedication : ( id : number , modifiedNewMedication : PatchMedication ) => void ;
99 delMedication : ( id : number ) => void ;
1010}
1111
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ export const MedicationProvider = ({ children }: { children: ReactNode }) => {
2626 setMedications ( prev => [ ...prev , medication ] ) ;
2727 } ;
2828
29- const modifyMedication = async ( id : number , oldmedication : PatchMedication ) => {
30- const newmedication = await modifyMedicationAPI ( id , oldmedication ) ;
29+ const modifyMedication = async ( id : number , modifiedNewMedication : PatchMedication ) => {
30+ const newmedication = await modifyMedicationAPI ( id , modifiedNewMedication ) ;
3131 setMedications ( prev => prev . map ( medication => medication . id === id
3232 ? newmedication
3333 : medication ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ interface ReminderContextType {
55 loading : boolean ;
66 reminders : Reminder [ ] ;
77 addReminder : ( newReminder : CreateReminder ) => void ;
8- modifyReminder : ( id : number , oldreminder : PatchReminder ) => void ;
8+ modifyReminder : ( id : number , modifiedNewReminder : PatchReminder ) => void ;
99 delReminder : ( id : number ) => void ;
1010}
1111
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ export const ReminderProvider = ({ children }: { children: ReactNode }) => {
2626 setReminders ( prev => [ reminder , ...prev ] ) ;
2727 } ;
2828
29- const modifyReminder = async ( id : number , oldreminder : PatchReminder ) => {
30- const newreminder = await modifyReminderAPI ( id , oldreminder ) ;
29+ const modifyReminder = async ( id : number , modifiedNewReminder : PatchReminder ) => {
30+ const newreminder = await modifyReminderAPI ( id , modifiedNewReminder ) ;
3131 setReminders ( prev => prev . map ( reminder => reminder . id === id ? newreminder : reminder ) ) ;
3232 } ;
3333
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ export const addMedicationAPI = async (newMedication: CreateMedication): Promise
1616
1717export const modifyMedicationAPI = async (
1818 id : number ,
19- newmedication : PatchMedication ,
19+ modifiedNewMedication : PatchMedication ,
2020) : Promise < Medication > => {
2121 return await apiService < Medication > ( {
2222 method : 'PATCH' ,
23- body : newmedication ,
23+ body : modifiedNewMedication ,
2424 route : `/medication/${ id } ` ,
2525 } ) ;
2626} ;
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ export const deleteReminderAPI = async (id: number): Promise<void> => {
1616
1717export const modifyReminderAPI = async (
1818 id : number ,
19- newreminder : PatchReminder ,
19+ modifiedNewReminder : PatchReminder ,
2020) : Promise < Reminder > => {
2121 return await apiService < Reminder > ( {
2222 method : 'PATCH' ,
23- body : newreminder ,
23+ body : modifiedNewReminder ,
2424 route : `/reminder/${ id } ` ,
2525 } ) ;
2626} ;
You can’t perform that action at this time.
0 commit comments