Skip to content

Commit 9bf3df4

Browse files
authored
Correction de bug (#33)
1 parent 4d41a71 commit 9bf3df4

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

pill_mate/frontend/src/context/MedicationContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

pill_mate/frontend/src/context/MedicationProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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,

pill_mate/frontend/src/context/ReminderContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

pill_mate/frontend/src/context/ReminderProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

pill_mate/frontend/src/services/medicationServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export const addMedicationAPI = async (newMedication: CreateMedication): Promise
1616

1717
export 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
};

pill_mate/frontend/src/services/reminderServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export const deleteReminderAPI = async (id: number): Promise<void> => {
1616

1717
export 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
};

0 commit comments

Comments
 (0)