refactor: simplify custom field shape

This commit is contained in:
Carlos Valente
2024-04-16 22:58:46 +02:00
committed by Carlos Valente
parent cf14b0b427
commit c4136a0ec7
15 changed files with 40 additions and 40 deletions
@@ -155,7 +155,7 @@ export const useEventAction = () => {
const updateCustomField = useCallback(
async (eventId: string, field: string, value: string) => {
updateEvent({ id: eventId, custom: { [field]: { value } } });
updateEvent({ id: eventId, custom: { [field]: value } });
},
[updateEvent],
);
@@ -22,7 +22,7 @@ describe('cloneEvent()', () => {
timeWarning: 120000,
timeDanger: 60000,
custom: {
lighting: { value: '3' },
lighting: '3',
} as EventCustomFields,
} as OntimeEvent;