diff --git a/eslint.config.js b/eslint.config.js index 8423101127..3df3c47f4d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,7 +17,6 @@ export default [ "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off", - "@typescript-eslint/require-await": "off", }, }, ]; diff --git a/src/components/events/partials/EventsStatusCell.tsx b/src/components/events/partials/EventsStatusCell.tsx index 259d58e752..20ee6a5d91 100644 --- a/src/components/events/partials/EventsStatusCell.tsx +++ b/src/components/events/partials/EventsStatusCell.tsx @@ -28,7 +28,7 @@ const EventsStatusCell = ({ } dispatch(fetchWorkflows(row.id)).unwrap() - .then(async workflows => { + .then(workflows => { // Open workflow overview modal if no workflows available if (!workflows.entries.length) { return dispatch(openModal(EventDetailsPage.Workflow, row)); diff --git a/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx b/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx index c8e8448b05..1c2ad20085 100644 --- a/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx @@ -399,10 +399,10 @@ const EditScheduledEventsEditPage = ({ { + () => { dispatch(removeNotificationWizardForm()); if ( - await checkSchedulingConflicts( + checkSchedulingConflicts( formik.values, setConflicts, dispatch, diff --git a/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx index 56bfe3e66f..25ea997e05 100644 --- a/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx @@ -179,7 +179,7 @@ const EventDetailsSchedulingTab = ({ }; // submits the formik form - const submitForm = async (values: SchedulingInfo) => { + const submitForm = (values: SchedulingInfo) => { dispatch(removeNotificationWizardForm()); const startDate = makeDate( values.scheduleStartDate, @@ -250,7 +250,7 @@ const EventDetailsSchedulingTab = ({ enableReinitialize initialValues={getInitialValues()} - onSubmit={values => submitForm(values).then(() => {})} + onSubmit={values => submitForm(values)} innerRef={formikRef} > {formik => ( diff --git a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx index f281bf5e68..40bca986b6 100644 --- a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx @@ -331,7 +331,7 @@ const OperationsPreview = ({ workflowDone = !(workflowStatus === "SUCCEEDED" || workflowStatus === "FAILED" || workflowStatus === "STOPPED"); } - const loadWorkflowOperations = async () => { + const loadWorkflowOperations = () => { // Fetching workflow operations from server if (workflowId) { dispatch(fetchWorkflowOperations({ eventId, workflowId })); @@ -340,7 +340,7 @@ const OperationsPreview = ({ useEffect(() => { // Fetch workflow operations initially - loadWorkflowOperations().then(); + loadWorkflowOperations(); // Fetch workflow operations every 5 seconds const fetchWorkflowOperationsInterval = setInterval(loadWorkflowOperations, 5000); diff --git a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx index 8c81872ab2..a03b219368 100644 --- a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx @@ -31,14 +31,14 @@ const EventDetailsWorkflowOperations = ({ const workflowId = useAppSelector(state => getModalWorkflowId(state)); const operations = useAppSelector(state => getWorkflowOperations(state)); - const loadWorkflowOperations = async () => { + const loadWorkflowOperations = () => { // Fetching workflow operations from server dispatch(fetchWorkflowOperations({ eventId, workflowId })); }; useEffect(() => { // Fetch workflow operations initially - loadWorkflowOperations().then(); + loadWorkflowOperations(); // Fetch workflow operations every 5 seconds const fetchWorkflowOperationsInterval = setInterval(loadWorkflowOperations, 5000); diff --git a/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx b/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx index c259312296..c0efae3087 100644 --- a/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx +++ b/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx @@ -184,8 +184,8 @@ const NewAccessPage = ({ {/* Button for navigation to next page and previous page */} { - if (await dispatch(checkAcls(formik.values.policies))) { + nextPage={() => { + if (dispatch(checkAcls(formik.values.policies))) { nextPage(formik.values); } }} diff --git a/src/components/events/partials/modals/EditScheduledEventsModal.tsx b/src/components/events/partials/modals/EditScheduledEventsModal.tsx index 0057eda968..2d8f1b69f7 100644 --- a/src/components/events/partials/modals/EditScheduledEventsModal.tsx +++ b/src/components/events/partials/modals/EditScheduledEventsModal.tsx @@ -89,16 +89,15 @@ const EditScheduledEventsModal = ({ errors.events = "Not all events editable!"; } if (steps[page].name !== "general") { - return checkSchedulingConflicts( + const isConflict = checkSchedulingConflicts( values, setConflicts, dispatch, - ).then(result => { - if (!result) { - errors.editedEvents = "Scheduling conflicts exist!"; - } - return errors; - }); + ); + if (!isConflict) { + errors.editedEvents = "Scheduling conflicts exist!"; + } + return errors; } else { return errors; } diff --git a/src/components/shared/RegistrationModal.tsx b/src/components/shared/RegistrationModal.tsx index 8647e014d7..96db89515b 100644 --- a/src/components/shared/RegistrationModal.tsx +++ b/src/components/shared/RegistrationModal.tsx @@ -76,7 +76,7 @@ const RegistrationModalContent = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const onClickContinue = async () => { + const onClickContinue = () => { // if state is deleteSubmit then delete infos about adaptor else show next state if (state === "deleteSubmit") { resetRegistrationData(); diff --git a/src/components/shared/Stats.tsx b/src/components/shared/Stats.tsx index 8aa42cf05a..2fb5794bbf 100644 --- a/src/components/shared/Stats.tsx +++ b/src/components/shared/Stats.tsx @@ -13,7 +13,6 @@ import { loadEventsIntoTable } from "../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../store"; import { fetchEvents } from "../../slices/eventSlice"; import { ParseKeys } from "i18next"; -import { Tooltip } from "./Tooltip"; import BaseButton from "./BaseButton"; /** diff --git a/src/components/shared/Table.tsx b/src/components/shared/Table.tsx index 5131d44744..7ef4359632 100644 --- a/src/components/shared/Table.tsx +++ b/src/components/shared/Table.tsx @@ -148,7 +148,7 @@ const Table = ({ } }; - const showEditTableViewModal = async () => { + const showEditTableViewModal = () => { editTableViewModalRef.current?.open(); }; diff --git a/src/components/shared/TableFilters.tsx b/src/components/shared/TableFilters.tsx index c85a7b4211..2f362505e4 100644 --- a/src/components/shared/TableFilters.tsx +++ b/src/components/shared/TableFilters.tsx @@ -161,7 +161,7 @@ const TableFilters = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [itemValue]); - const handleDatepicker = async (dates?: [Date | undefined | null, Date | undefined | null]) => { + const handleDatepicker = (dates?: [Date | undefined | null, Date | undefined | null]) => { if (dates != null) { const [start, end] = dates; @@ -185,7 +185,7 @@ const TableFilters = ({ // Workaround for entering a date range by only entering one date // (e.g. 01/01/2025 results in a range of 01/01/2025 - 01/01/2025) - const handleDatePickerOnKeyDown = async (keyEvent: React.KeyboardEvent) => { + const handleDatePickerOnKeyDown = (keyEvent: React.KeyboardEvent) => { if (keyEvent.key === "Enter") { const end = endDate ?? (startDate ? new Date(startDate) : undefined); end?.setHours(23); diff --git a/src/components/shared/TimeSeriesStatistics.tsx b/src/components/shared/TimeSeriesStatistics.tsx index 4bfea7f02d..01c10b04d1 100644 --- a/src/components/shared/TimeSeriesStatistics.tsx +++ b/src/components/shared/TimeSeriesStatistics.tsx @@ -107,7 +107,7 @@ const TimeSeriesStatistics = ({ }; // change time mode in formik and get new values from API - const changeTimeMode = async ( + const changeTimeMode = ( newTimeMode: TimeMode, setFormikValue: (field: string, value: any) => Promise>, from: string, @@ -119,7 +119,7 @@ const TimeSeriesStatistics = ({ }; // change custom time granularity in formik and get new values from API - const changeGranularity = async ( + const changeGranularity = ( granularity: DataResolution, setFormikValue: (field: string, value: any) => Promise>, timeMode: TimeMode, diff --git a/src/components/shared/wizard/SelectContainer.tsx b/src/components/shared/wizard/SelectContainer.tsx index 3b6b7ff540..19e9dbff98 100644 --- a/src/components/shared/wizard/SelectContainer.tsx +++ b/src/components/shared/wizard/SelectContainer.tsx @@ -78,7 +78,7 @@ const SelectContainer = ({ setItems(defaultItems); }; - const handleChangeSearch = async (input: string) => { + const handleChangeSearch = (input: string) => { const filtered = defaultItems.filter(item => { return item.name.toLowerCase().includes(input.toLowerCase()); }); diff --git a/src/components/shared/wizard/WizardStepper.tsx b/src/components/shared/wizard/WizardStepper.tsx index a26694cfc4..19603e7277 100644 --- a/src/components/shared/wizard/WizardStepper.tsx +++ b/src/components/shared/wizard/WizardStepper.tsx @@ -40,10 +40,10 @@ const WizardStepper = ({ const { t } = useTranslation(); const dispatch = useAppDispatch(); - const handleOnClick = async (key: number) => { + const handleOnClick = (key: number) => { if (isSummaryReachable(key, steps, completed)) { if (acls) { - const check = await dispatch(checkAcls(acls)); + const check = dispatch(checkAcls(acls)); if (!check) { return; } diff --git a/src/components/systems/partials/ServersMaintenanceCell.tsx b/src/components/systems/partials/ServersMaintenanceCell.tsx index c35b051b12..b72247266b 100644 --- a/src/components/systems/partials/ServersMaintenanceCell.tsx +++ b/src/components/systems/partials/ServersMaintenanceCell.tsx @@ -21,7 +21,7 @@ const ServersMaintenanceCell = ({ const dispatch = useAppDispatch(); const onClickCheckbox = async (e: React.ChangeEvent) => { - await dispatch(setServerMaintenance({ host: row.hostname, maintenance: e.target.checked })); + setServerMaintenance({ host: row.hostname, maintenance: e.target.checked }); await dispatch(fetchServers()); dispatch(loadServersIntoTable()); }; diff --git a/src/components/systems/partials/ServicesActionsCell.tsx b/src/components/systems/partials/ServicesActionsCell.tsx index 11a9ffd724..09f4910a42 100644 --- a/src/components/systems/partials/ServicesActionsCell.tsx +++ b/src/components/systems/partials/ServicesActionsCell.tsx @@ -14,7 +14,7 @@ const ServicesActionCell = ({ const dispatch = useAppDispatch(); const onClickRestart = async () => { - await dispatch(restartService({ host: row.hostname, serviceType: row.name })); + restartService({ host: row.hostname, serviceType: row.name }); await dispatch(fetchServices()); dispatch(loadServicesIntoTable()); }; diff --git a/src/components/users/partials/modal/AclDetails.tsx b/src/components/users/partials/modal/AclDetails.tsx index 364170a552..a3f32db253 100644 --- a/src/components/users/partials/modal/AclDetails.tsx +++ b/src/components/users/partials/modal/AclDetails.tsx @@ -90,8 +90,8 @@ const AclDetails = ({ formik={formik} previousPage={close} submitPage={ - async () => { - if (await dispatch(checkAcls(formik.values.policies))) { + () => { + if (dispatch(checkAcls(formik.values.policies))) { formik.handleSubmit(); } } diff --git a/src/components/users/partials/wizard/AclAccessPage.tsx b/src/components/users/partials/wizard/AclAccessPage.tsx index c80a890618..0651ce297b 100644 --- a/src/components/users/partials/wizard/AclAccessPage.tsx +++ b/src/components/users/partials/wizard/AclAccessPage.tsx @@ -151,8 +151,8 @@ const AclAccessPage = ({ { - if (await dispatch(checkAcls(formik.values.policies))) { + () => { + if (dispatch(checkAcls(formik.values.policies))) { nextPage(formik.values); } } diff --git a/src/components/users/partials/wizard/UserEffectiveRolesTab.tsx b/src/components/users/partials/wizard/UserEffectiveRolesTab.tsx index d49fb0d8bd..48c431becc 100644 --- a/src/components/users/partials/wizard/UserEffectiveRolesTab.tsx +++ b/src/components/users/partials/wizard/UserEffectiveRolesTab.tsx @@ -29,7 +29,7 @@ const UserEffectiveRolesTab = ({ setItems(defaultItems); }; - const handleChangeSearch = async (input: string) => { + const handleChangeSearch = (input: string) => { const filtered = defaultItems.filter(item => { return item.name.toLowerCase().includes(input.toLowerCase()); }); diff --git a/src/slices/aclDetailsSlice.ts b/src/slices/aclDetailsSlice.ts index 7d24ae68a2..13c38f3149 100644 --- a/src/slices/aclDetailsSlice.ts +++ b/src/slices/aclDetailsSlice.ts @@ -4,6 +4,7 @@ import { prepareAccessPolicyRulesForPost } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { Acl } from "./aclSlice"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of details of an ACL @@ -132,13 +133,13 @@ export const fetchAclDetails = createAppAsyncThunk("aclDetails/fetchAclDetails", }); // update details of a certain acl -export const updateAclDetails = createAppAsyncThunk("aclDetails/updateAclDetails", async (params: { +export const updateAclDetails = (params: { values: { name: string, policies: TransformedAcl[], }, aclId: number, -}, { dispatch }) => { +}): AppThunk => dispatch => { const { values, aclId } = params; // transform ACLs back to structure used by backend const acls = prepareAccessPolicyRulesForPost(values.policies); @@ -159,7 +160,7 @@ export const updateAclDetails = createAppAsyncThunk("aclDetails/updateAclDetails console.error(response); dispatch(addNotification({ type: "error", key: "ACL_NOT_SAVED" })); }); -}); +}; const aclDetailsSlice = createSlice({ name: "aclDetails", diff --git a/src/slices/aclSlice.ts b/src/slices/aclSlice.ts index 9689ef722e..a42961e4ef 100644 --- a/src/slices/aclSlice.ts +++ b/src/slices/aclSlice.ts @@ -6,7 +6,7 @@ import { transformToIdValueArray } from "../utils/utils"; import { NOTIFICATION_CONTEXT_ACCESS } from "../configs/modalConfig"; import { addNotification, removeNotificationWizardAccess } from "./notificationSlice"; import { getUserInformation } from "../selectors/userInfoSelectors"; -import { AppDispatch, RootState } from "../store"; +import { AppDispatch, AppThunk, RootState } from "../store"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { initialFormValuesNewAcl } from "../configs/modalConfig"; import { TransformedAcl } from "./aclDetailsSlice"; @@ -144,7 +144,7 @@ export const fetchRolesWithTarget = async (target: string) => { }; // post new acl to backend -export const postNewAcl = (values: typeof initialFormValuesNewAcl) => async (dispatch: AppDispatch) => { +export const postNewAcl = (values: typeof initialFormValuesNewAcl): AppThunk => dispatch => { const acls = prepareAccessPolicyRulesForPost(values.policies); const data = new URLSearchParams(); @@ -166,8 +166,9 @@ export const postNewAcl = (values: typeof initialFormValuesNewAcl) => async (dis dispatch(addNotification({ type: "error", key: "ACL_NOT_SAVED" })); }); }; + // delete acl with provided id -export const deleteAcl = (id: number) => async (dispatch: AppDispatch) => { +export const deleteAcl = (id: number): AppThunk => dispatch => { axios .delete(`/admin-ng/acl/${id}`) .then(res => { @@ -183,7 +184,7 @@ export const deleteAcl = (id: number) => async (dispatch: AppDispatch) => { }; -export const checkAcls = (acls: TransformedAcl[]) => async (dispatch: AppDispatch, getState: () => RootState) => { +export const checkAcls = (acls: TransformedAcl[]) => (dispatch: AppDispatch, getState: () => RootState) => { // Remove old notifications of context event-access // Helps to prevent multiple notifications for same problem dispatch(removeNotificationWizardAccess()); diff --git a/src/slices/eventDetailsSlice.ts b/src/slices/eventDetailsSlice.ts index a0b7e603e2..cb85ba61ca 100644 --- a/src/slices/eventDetailsSlice.ts +++ b/src/slices/eventDetailsSlice.ts @@ -33,7 +33,7 @@ import { EventDetailsPage, WorkflowTabHierarchy, } from "../components/events/partials/modals/EventDetails"; -import { AppDispatch } from "../store"; +import { AppDispatch, AppThunk } from "../store"; import { Ace } from "./aclSlice"; import { setTobiraTabHierarchy, TobiraData } from "./seriesDetailsSlice"; import { handleTobiraError } from "./shared/tobiraErrors"; @@ -1642,10 +1642,10 @@ export const fetchHasActiveTransactions = createAppAsyncThunk("eventDetails/fetc return hasActiveTransactions; }); -export const updateAssets = createAppAsyncThunk("eventDetails/updateAssets", async (params: { +export const updateAssets = (params: { values: { [key: string]: File }, eventId: Event["id"] -}, { dispatch, getState }) => { +}): AppThunk => (dispatch, getState) => { const { values, eventId } = params; // get asset upload options from redux store const state = getState(); @@ -1725,7 +1725,7 @@ export const updateAssets = createAppAsyncThunk("eventDetails/updateAssets", asy }), ); }); -}); +}; export const saveAccessPolicies = createAppAsyncThunk("eventDetails/saveAccessPolicies", async ( params: { @@ -1815,13 +1815,20 @@ export const deleteCommentReply = createAppAsyncThunk("eventDetails/deleteCommen return true; }); -export const saveWorkflowConfig = createAppAsyncThunk("eventDetails/saveWorkflowConfig", async (params: { +export const saveWorkflowConfig = (params: { values: { workflowDefinition: string, configuration: { [key: string]: unknown } | undefined }, eventId: Event["id"] -}, { dispatch }) => { +}): AppThunk => dispatch => { +// export const saveWorkflowConfig = createAppAsyncThunk("eventDetails/saveWorkflowConfig", async (params: { +// values: { +// workflowDefinition: string, +// configuration: { [key: string]: unknown } | undefined +// }, +// eventId: Event["id"] +// }, { dispatch }) => { const { values, eventId } = params; const jsonData = { id: values.workflowDefinition, @@ -1852,7 +1859,7 @@ export const saveWorkflowConfig = createAppAsyncThunk("eventDetails/saveWorkflow }), ); }); -}); +}; const eventDetailsSlice = createSlice({ name: "eventDetails", diff --git a/src/slices/eventSlice.ts b/src/slices/eventSlice.ts index 5d08f3b6c8..2e4604a083 100644 --- a/src/slices/eventSlice.ts +++ b/src/slices/eventSlice.ts @@ -22,7 +22,7 @@ import { } from "./notificationSlice"; import { getAssetUploadOptions, getSchedulingEditedEvents, getSourceUploadOptions } from "../selectors/eventSelectors"; import { fetchSeriesOptions } from "./seriesSlice"; -import { AppDispatch } from "../store"; +import { AppDispatch, AppThunk } from "../store"; import { fetchAssetUploadOptions } from "../thunks/assetsThunks"; import { TransformedAcl } from "./aclDetailsSlice"; import { TableConfig } from "../configs/tableConfigs/aclsTableConfig"; @@ -344,7 +344,7 @@ export const postEditMetadata = createAppAsyncThunk("events/postEditMetadata", a }; }); -export const updateBulkMetadata = createAppAsyncThunk("events/updateBulkMetadata", async (params: { +export const updateBulkMetadata = (params: { metadataFields: { merged: string[], mergedMetadata: MetadataFieldSelected[], @@ -352,7 +352,7 @@ export const updateBulkMetadata = createAppAsyncThunk("events/updateBulkMetadata runningWorkflow?: string[], }, values: { [key: string]: unknown } -}, { dispatch }) => { +}): AppThunk => dispatch => { const { metadataFields, values } = params; const formData = new URLSearchParams(); @@ -431,9 +431,9 @@ export const updateBulkMetadata = createAppAsyncThunk("events/updateBulkMetadata } } }); -}); +}; -export const postNewEvent = createAppAsyncThunk("events/postNewEvent", async (params: { +export const postNewEvent = (params: { values: { policies: TransformedAcl[], configuration: { [key: string]: unknown }, @@ -454,7 +454,7 @@ export const postNewEvent = createAppAsyncThunk("events/postNewEvent", async (pa }, metadataInfo: MetadataCatalog, extendedMetadata: MetadataCatalog[], -}, { dispatch, getState }) => { +}): AppThunk => (dispatch, getState) => { const { values, metadataInfo, extendedMetadata } = params; // get asset upload options from redux store @@ -668,10 +668,10 @@ export const postNewEvent = createAppAsyncThunk("events/postNewEvent", async (pa console.error(response); dispatch(addNotification({ type: "error", key: "EVENTS_NOT_CREATED" })); }); -}); +}; // delete event with provided id -export const deleteEvent = createAppAsyncThunk("events/deleteEvent", async (id: Event["id"], { dispatch }) => { +export const deleteEvent = (id: Event["id"]): AppThunk => dispatch => { // API call for deleting an event axios .delete(`/admin-ng/event/${id}`) @@ -691,9 +691,9 @@ export const deleteEvent = createAppAsyncThunk("events/deleteEvent", async (id: dispatch(addNotification({ type: "error", key: "EVENTS_NOT_DELETED" })); } }); -}); +}; -export const deleteMultipleEvent = createAppAsyncThunk("events/deleteMultipleEvent", async (events: Event[], { dispatch }) => { +export const deleteMultipleEvent = (events: Event[]): AppThunk => dispatch => { const data = []; for (const event of events) { @@ -714,7 +714,7 @@ export const deleteMultipleEvent = createAppAsyncThunk("events/deleteMultipleEve // add error notification dispatch(addNotification({ type: "error", key: "EVENTS_NOT_DELETED" })); }); -}); +}; export const fetchScheduling = createAppAsyncThunk("events/fetchScheduling", async (params: { events: Event[], @@ -801,13 +801,11 @@ export const fetchScheduling = createAppAsyncThunk("events/fetchScheduling", asy }); // update multiple scheduled events at once -export const updateScheduledEventsBulk = createAppAsyncThunk("events/updateScheduledEventsBulk", async ( - values: { - changedEvents: string[], - editedEvents: EditedEvents[], - events: Event[], - }, -{ dispatch }) => { +export const updateScheduledEventsBulk = (values: { + changedEvents: string[], + editedEvents: EditedEvents[], + events: Event[], +}): AppThunk => dispatch => { const formData = new FormData(); const update = []; const timezone = moment.tz.guess(); @@ -889,7 +887,7 @@ export const updateScheduledEventsBulk = createAppAsyncThunk("events/updateSched console.error(res); dispatch(addNotification({ type: "error", key: "EVENTS_NOT_UPDATED_ALL" })); }); -}); +}; // check provided date range for conflicts @@ -1060,7 +1058,7 @@ export const checkForConflicts = async ( }; // check if there are any scheduling conflicts with other events -export const checkForSchedulingConflicts = (events: EditedEvents[]) => async (dispatch: AppDispatch) => { +export const checkForSchedulingConflicts = (events: EditedEvents[]) => (dispatch: AppDispatch) => { const formData = new FormData(); const update = []; const timezone = moment.tz.guess(); diff --git a/src/slices/groupDetailsSlice.ts b/src/slices/groupDetailsSlice.ts index 135578761b..2d0bcffb61 100644 --- a/src/slices/groupDetailsSlice.ts +++ b/src/slices/groupDetailsSlice.ts @@ -4,6 +4,7 @@ import { buildGroupBody } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { Group } from "./groupSlice"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of details of a group @@ -63,10 +64,10 @@ export const fetchGroupDetails = createAppAsyncThunk("groupDetails/fetchGroupDet }); // update details of a certain group -export const updateGroupDetails = createAppAsyncThunk("groupDetails/updateGroupDetails", async (params: { +export const updateGroupDetails = (params: { values: UpdateGroupDetailsState, groupId: GroupDetails["id"] -}, { dispatch }) => { +}): AppThunk => dispatch => { const { values, groupId } = params; // get URL params used for put request @@ -87,7 +88,7 @@ export const updateGroupDetails = createAppAsyncThunk("groupDetails/updateGroupD dispatch(addNotification({ type: "error", key: "GROUP_NOT_SAVED" })); } }); -}); +}; const groupDetailsSlice = createSlice({ name: "groupDetails", diff --git a/src/slices/groupSlice.ts b/src/slices/groupSlice.ts index c13acefaf1..7b50bf34ce 100644 --- a/src/slices/groupSlice.ts +++ b/src/slices/groupSlice.ts @@ -6,6 +6,7 @@ import { addNotification } from "./notificationSlice"; import { TableConfig } from "../configs/tableConfigs/aclsTableConfig"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { initialFormValuesNewGroup } from "../configs/modalConfig"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of groups @@ -67,7 +68,7 @@ export const fetchGroups = createAppAsyncThunk("groups/fetchGroups", async (_, { }); // post new group to backend -export const postNewGroup = createAppAsyncThunk("groups/postNewGroup", async (values: typeof initialFormValuesNewGroup, { dispatch }) => { +export const postNewGroup = (values: typeof initialFormValuesNewGroup): AppThunk => dispatch => { // get URL params used for post request const data = buildGroupBody(values); @@ -89,9 +90,9 @@ export const postNewGroup = createAppAsyncThunk("groups/postNewGroup", async (va dispatch(addNotification({ type: "error", key: "GROUP_NOT_SAVED" })); } }); -}); +}; -export const deleteGroup = createAppAsyncThunk("groups/deleteGroup", async (id: Group["id"], { dispatch }) => { +export const deleteGroup = (id: Group["id"]): AppThunk => dispatch => { // API call for deleting a group axios .delete(`/admin-ng/groups/${id}`) @@ -104,7 +105,7 @@ export const deleteGroup = createAppAsyncThunk("groups/deleteGroup", async (id: // add error notification dispatch(addNotification({ type: "error", key: "GROUP_NOT_DELETED" })); }); -}); +}; const groupSlice = createSlice({ name: "groups", diff --git a/src/slices/notificationSlice.ts b/src/slices/notificationSlice.ts index c3eb0ac8aa..7245af0944 100644 --- a/src/slices/notificationSlice.ts +++ b/src/slices/notificationSlice.ts @@ -11,8 +11,8 @@ import { ADMIN_NOTIFICATION_DURATION_WARNING, } from "../configs/generalConfig"; import { getLastAddedNotification } from "../selectors/notificationSelector"; -import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { ParseKeys } from "i18next"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of table @@ -44,7 +44,7 @@ const initialState: NotificationState = { // Counter for id of notifications let nextNotificationId = 0; -export const addNotification = createAppAsyncThunk("notifications/addNotification", async (params: { +export const addNotification = (params: { type: OurNotification["type"], key: OurNotification["key"], duration?: OurNotification["duration"], @@ -52,7 +52,7 @@ export const addNotification = createAppAsyncThunk("notifications/addNotificatio context?: OurNotification["context"], id?: OurNotification["id"] noDuplicates?: boolean, // Do not add this notification if one with the same key already exists (in the same context) -}, { dispatch, getState }) => { +}): AppThunk => (dispatch, getState) => { let { duration, parameter, context } = params; const { type, key, id, noDuplicates } = params; @@ -130,7 +130,7 @@ export const addNotification = createAppAsyncThunk("notifications/addNotificatio } return dispatchedNotification.payload.id; -}); +}; // Reducer for notifications const notificationSlice = createSlice({ diff --git a/src/slices/recordingSlice.ts b/src/slices/recordingSlice.ts index 21c2fad755..b24f94a1ef 100644 --- a/src/slices/recordingSlice.ts +++ b/src/slices/recordingSlice.ts @@ -5,6 +5,7 @@ import { getURLParams } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { TableConfig } from "../configs/tableConfigs/aclsTableConfig"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of recordings @@ -106,7 +107,7 @@ export const fetchRecordings = createAppAsyncThunk("recordings/fetchRecordings", }); // delete location with provided id -export const deleteRecording = createAppAsyncThunk("recordings/deleteRecording", async (id: Recording["id"], { dispatch }) => { +export const deleteRecording = (id: Recording["id"]): AppThunk => dispatch => { // API call for deleting a location axios .delete(`/admin-ng/capture-agents/${id}`) @@ -126,7 +127,7 @@ export const deleteRecording = createAppAsyncThunk("recordings/deleteRecording", dispatch(addNotification({ type: "error", key: "LOCATION_NOT_DELETED" })); } }); -}); +}; const recordingSlice = createSlice({ name: "recordings", diff --git a/src/slices/seriesDetailsSlice.ts b/src/slices/seriesDetailsSlice.ts index 78d5287ef8..defc45d805 100644 --- a/src/slices/seriesDetailsSlice.ts +++ b/src/slices/seriesDetailsSlice.ts @@ -21,6 +21,7 @@ import { Series, TobiraPage } from "./seriesSlice"; import { TobiraTabHierarchy } from "../components/events/partials/ModalTabsAndPages/DetailsTobiraTab"; import { TobiraFormProps } from "../components/events/partials/ModalTabsAndPages/NewTobiraPage"; import { handleTobiraError } from "./shared/tobiraErrors"; +import { AppThunk } from "../store"; /** @@ -286,10 +287,10 @@ export const updateSeriesAccess = createAppAsyncThunk("seriesDetails/updateSerie }); }); -export const updateSeriesTheme = createAppAsyncThunk("seriesDetails/updateSeriesTheme", async (params: { +export const updateSeriesTheme = (params: { id: string, values: { theme: SeriesDetailsState["theme"] }, -}, { dispatch }) => { +}): AppThunk => dispatch => { const { id, values } = params; const themeId = values.theme?.id; @@ -336,7 +337,7 @@ export const updateSeriesTheme = createAppAsyncThunk("seriesDetails/updateSeries console.error(response); }); } -}); +}; // fetch Tobira data of certain series from server export const fetchSeriesDetailsTobira = createAppAsyncThunk("seriesDetails/fetchSeriesDetailsTobira", async ( diff --git a/src/slices/seriesSlice.ts b/src/slices/seriesSlice.ts index fa454d4757..aaeeb5b544 100644 --- a/src/slices/seriesSlice.ts +++ b/src/slices/seriesSlice.ts @@ -16,6 +16,7 @@ import { TransformedAcl } from "./aclDetailsSlice"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { MetadataCatalog } from "./eventSlice"; import { handleTobiraError } from "./shared/tobiraErrors"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of series @@ -181,7 +182,7 @@ export const fetchSeriesThemes = createAppAsyncThunk("series/fetchSeriesThemes", }); // post new series to backend -export const postNewSeries = createAppAsyncThunk("series/postNewSeries", async (params: { +export const postNewSeries = (params: { values: { [key: string]: any; policies: TransformedAcl[], @@ -200,7 +201,7 @@ export const postNewSeries = createAppAsyncThunk("series/postNewSeries", async ( }, metadataInfo: MetadataCatalog, extendedMetadata: MetadataCatalog[] -}, { dispatch }) => { +}): AppThunk => dispatch => { const { values, metadataInfo, extendedMetadata } = params; // prepare metadata provided by user @@ -282,7 +283,7 @@ export const postNewSeries = createAppAsyncThunk("series/postNewSeries", async ( console.error(response); dispatch(addNotification({ type: "error", key: "SERIES_NOT_SAVED" })); }); -}); +}; // check for events of the series and if deleting the series if it has events is allowed export const checkForEventsDeleteSeriesModal = createAppAsyncThunk("series/checkForEventsDeleteSeriesModal", async (id: Series["id"], { dispatch }) => { @@ -304,8 +305,8 @@ export const checkForEventsDeleteSeriesModal = createAppAsyncThunk("series/check ); }); -// delete series with provided id -export const deleteSeries = createAppAsyncThunk("series/deleteSeries", async (id: Series["id"], { dispatch }) => { +// delete series with provided +export const deleteSeries = (id: Series["id"]): AppThunk => dispatch => { // API call for deleting a series axios .delete(`/admin-ng/series/${id}`) @@ -319,10 +320,10 @@ export const deleteSeries = createAppAsyncThunk("series/deleteSeries", async (id // add error notification dispatch(addNotification({ type: "error", key: "SERIES_NOT_DELETED" })); }); -}); +}; // delete series with provided ids -export const deleteMultipleSeries = createAppAsyncThunk("series/deleteMultipleSeries", async ( +export const deleteMultipleSeries = ( series: { contributors: string[], createdBy: string, @@ -333,7 +334,7 @@ export const deleteMultipleSeries = createAppAsyncThunk("series/deleteMultipleSe selected: boolean, title: string, }[], -{ dispatch }) => { +): AppThunk => dispatch => { const data = []; for (let i = 0; i < series.length; i++) { @@ -354,7 +355,7 @@ export const deleteMultipleSeries = createAppAsyncThunk("series/deleteMultipleSe // add error notification dispatch(addNotification({ type: "error", key: "SERIES_NOT_DELETED" })); }); -}); +}; // fetch metadata of certain series from server export const fetchSeriesDetailsTobiraNew = createAppAsyncThunk("seriesDetails/fetchSeriesDetailsTobiraNew", async (path: TobiraPage["path"], { dispatch }) => { diff --git a/src/slices/serverSlice.ts b/src/slices/serverSlice.ts index b276b27806..83076825f8 100644 --- a/src/slices/serverSlice.ts +++ b/src/slices/serverSlice.ts @@ -68,7 +68,7 @@ export const fetchServers = createAppAsyncThunk("servers/fetchServers", async (_ }); // change maintenance status of a server/host -export const setServerMaintenance = createAppAsyncThunk("servers/setServerMaintenance", async (params: { +export const setServerMaintenance = (params: { host: Server["hostname"], maintenance: Server["maintenance"] }) => { @@ -85,7 +85,7 @@ export const setServerMaintenance = createAppAsyncThunk("servers/setServerMainte .catch(response => { console.error(response); }); -}); +}; const serverSlice = createSlice({ name: "servers", diff --git a/src/slices/serviceSlice.ts b/src/slices/serviceSlice.ts index 9a094f1784..0163405b46 100644 --- a/src/slices/serviceSlice.ts +++ b/src/slices/serviceSlice.ts @@ -71,7 +71,7 @@ export const fetchServices = createAppAsyncThunk("services/fetchServices", async }); // restarts a service after initiated by user -export const restartService = createAppAsyncThunk("services/fetchServices", async (params: { +export const restartService = (params: { host: Service["hostname"], serviceType: string }) => { @@ -88,7 +88,7 @@ export const restartService = createAppAsyncThunk("services/fetchServices", asyn .catch(response => { console.log(response); }); -}); +}; const serviceSlice = createSlice({ name: "services", diff --git a/src/slices/themeDetailsSlice.ts b/src/slices/themeDetailsSlice.ts index 73a92d06de..d41ad2ff71 100644 --- a/src/slices/themeDetailsSlice.ts +++ b/src/slices/themeDetailsSlice.ts @@ -4,6 +4,7 @@ import { buildThemeBody } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { ThemeDetailsInitialValues, ThemeDetailsType } from "./themeSlice"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of a theme @@ -67,10 +68,10 @@ export const fetchUsage = createAppAsyncThunk("themeDetails/fetchUsage", async ( }); // update a certain theme -export const updateThemeDetails = createAppAsyncThunk("themeDetails/updateThemeDetails", async (params: { +export const updateThemeDetails = (params: { id: ThemeDetailsState["details"]["id"], values: ThemeDetailsInitialValues -}, { dispatch }) => { +}): AppThunk => dispatch => { const { values, id } = params; const data = buildThemeBody(values); @@ -89,7 +90,7 @@ export const updateThemeDetails = createAppAsyncThunk("themeDetails/updateThemeD console.error(response); dispatch(addNotification({ type: "error", key: "THEME_NOT_CREATED" })); }); -}); +}; const themeDetailsSlice = createSlice({ name: "themeDetails", diff --git a/src/slices/themeSlice.ts b/src/slices/themeSlice.ts index ba8eabaad9..7977c0bb18 100644 --- a/src/slices/themeSlice.ts +++ b/src/slices/themeSlice.ts @@ -5,6 +5,7 @@ import { buildThemeBody, getURLParams } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { TableConfig } from "../configs/tableConfigs/aclsTableConfig"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of themes @@ -83,7 +84,7 @@ export const fetchThemes = createAppAsyncThunk("theme/fetchThemes", async (_, { }); // post new theme to backend -export const postNewTheme = createAppAsyncThunk("theme/postNewTheme", async (values: ThemeDetailsInitialValues +export const postNewTheme = (values: ThemeDetailsInitialValues, // All params that would be accepted by the endpoint // { // default: boolean, @@ -103,7 +104,7 @@ export const postNewTheme = createAppAsyncThunk("theme/postNewTheme", async (val // licenseSlideDescription: string, // watermarkPosition: string, // } -, { dispatch }) => { +): AppThunk => dispatch => { // get URL params used for post request const data = buildThemeBody(values); @@ -124,10 +125,10 @@ export const postNewTheme = createAppAsyncThunk("theme/postNewTheme", async (val console.error(response); dispatch(addNotification({ type: "error", key: "THEME_NOT_CREATED" })); }); -}); +}; // delete theme with provided id -export const deleteTheme = createAppAsyncThunk("theme/deleteTheme", async (id: ThemeDetailsType["id"], { dispatch }) => { +export const deleteTheme = (id: ThemeDetailsType["id"]): AppThunk => dispatch => { axios .delete(`/admin-ng/themes/${id}`) .then(res => { @@ -140,7 +141,7 @@ export const deleteTheme = createAppAsyncThunk("theme/deleteTheme", async (id: T // add error notification dispatch(addNotification({ type: "error", key: "THEME_NOT_DELETED" })); }); -}); +}; const themeSlice = createSlice({ name: "theme", diff --git a/src/slices/userDetailsSlice.ts b/src/slices/userDetailsSlice.ts index 411889157a..17bf2f81fc 100644 --- a/src/slices/userDetailsSlice.ts +++ b/src/slices/userDetailsSlice.ts @@ -4,6 +4,7 @@ import { addNotification } from "./notificationSlice"; import { buildUserBody } from "../utils/resourceUtils"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; import { UserRole } from "./userSlice"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of details of a user @@ -58,10 +59,10 @@ export const fetchUserDetails = createAppAsyncThunk("userDetails/fetchUserDetail }); // update existing user with changed values -export const updateUserDetails = createAppAsyncThunk("userDetails/updateUserDetails", async (params: { +export const updateUserDetails = (params: { values: UpdateUser, username: UserDetailsState["name"] -}, { dispatch }) => { +}): AppThunk => dispatch => { const { username, values } = params; // get URL params used for put request @@ -78,7 +79,7 @@ export const updateUserDetails = createAppAsyncThunk("userDetails/updateUserDeta console.error(response); dispatch(addNotification({ type: "error", key: "USER_NOT_SAVED" })); }); -}); +}; const userDetailsSlice = createSlice({ name: "userDetails", diff --git a/src/slices/userSlice.ts b/src/slices/userSlice.ts index 5c7b88f563..59ee5adf85 100644 --- a/src/slices/userSlice.ts +++ b/src/slices/userSlice.ts @@ -6,6 +6,7 @@ import { buildUserBody, getURLParams } from "../utils/resourceUtils"; import { addNotification } from "./notificationSlice"; import { TableConfig } from "../configs/tableConfigs/aclsTableConfig"; import { createAppAsyncThunk } from "../createAsyncThunkWithTypes"; +import { AppThunk } from "../store"; /** * This file contains redux reducer for actions affecting the state of users @@ -87,7 +88,7 @@ export const fetchUsersForTemplate = async (roles: string[]) => { }; // new user to backend -export const postNewUser = createAppAsyncThunk("users/postNewUser", async (values: NewUser, { dispatch }) => { +export const postNewUser = (values: NewUser): AppThunk => dispatch => { // get URL params used for post request const data = buildUserBody(values); @@ -108,10 +109,10 @@ export const postNewUser = createAppAsyncThunk("users/postNewUser", async (value console.error(response); dispatch(addNotification({ type: "error", key: "USER_NOT_SAVED" })); }); -}); +}; // delete user with provided id -export const deleteUser = createAppAsyncThunk("users/deleteUser", async (id: string, { dispatch }) => { +export const deleteUser = (id: string): AppThunk => dispatch => { // API call for deleting an user axios .delete(`/admin-ng/users/${id}.json`) @@ -125,7 +126,7 @@ export const deleteUser = createAppAsyncThunk("users/deleteUser", async (id: str // add error notification dispatch(addNotification({ type: "error", key: "USER_NOT_DELETED" })); }); -}); +}; // get users and their user names export const fetchUsersAndUsernames = async () => { diff --git a/src/store.ts b/src/store.ts index 48f8bb095b..76a3f65d9f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -108,7 +108,7 @@ export const useAppSelector: TypedUseSelectorHook = useSelector; export type AppThunk = ThunkAction< ReturnType, RootState, - unknown, + undefined, UnknownAction > diff --git a/src/thunks/tableThunks.ts b/src/thunks/tableThunks.ts index 87ee2d7ebe..9bf5677c60 100644 --- a/src/thunks/tableThunks.ts +++ b/src/thunks/tableThunks.ts @@ -41,7 +41,7 @@ import { AppDispatch, AppThunk, RootState } from "../store"; * */ // Method to load events into the table -export const loadEventsIntoTable = (): AppThunk => async (dispatch, getState) => { +export const loadEventsIntoTable = (): AppThunk => (dispatch, getState) => { const { events, table } = getState(); const total = events.total; diff --git a/src/thunks/taskThunks.ts b/src/thunks/taskThunks.ts index 608384cdfd..9c5eeb0ee6 100644 --- a/src/thunks/taskThunks.ts +++ b/src/thunks/taskThunks.ts @@ -9,7 +9,7 @@ export const postTasks = ( configuration: { [key: string] : string } workflow: string }, -) => async (dispatch: AppDispatch) => { +) => (dispatch: AppDispatch) => { const configuration: { [key: string] : string } = {}; Object.keys(values.configuration).forEach(config => { configuration[config] = String(values.configuration[config]); diff --git a/src/utils/aclUtils.ts b/src/utils/aclUtils.ts index 755aef30e5..f1d5066388 100644 --- a/src/utils/aclUtils.ts +++ b/src/utils/aclUtils.ts @@ -111,5 +111,5 @@ export const handleTemplateChange = async 0) { setConflicts(response); diff --git a/src/utils/dateUtils.ts b/src/utils/dateUtils.ts index cca6cbbd35..cdb6adff4b 100644 --- a/src/utils/dateUtils.ts +++ b/src/utils/dateUtils.ts @@ -188,7 +188,7 @@ export const changeStartDate = ( ); }; -export const changeStartHour = async ( +export const changeStartHour = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, scheduleStartMinute: string }, setFieldValue: (field: string, value: string) => Promise>, @@ -210,7 +210,7 @@ export const changeStartHour = async ( setFieldValue("scheduleStartHour", value); }; -export const changeStartMinute = async ( +export const changeStartMinute = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, scheduleStartHour: string }, setFieldValue: (field: string, value: string) => Promise>, @@ -271,7 +271,7 @@ const changeEnd = ( } }; -export const changeEndHour = async ( +export const changeEndHour = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, scheduleStartHour: string, scheduleStartMinute: string }, setFieldValue: (field: string, value: string) => Promise>, @@ -292,7 +292,7 @@ export const changeEndHour = async ( setFieldValue("scheduleEndHour", value); }; -export const changeEndMinute = async ( +export const changeEndMinute = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, scheduleStartHour: string, scheduleStartMinute: string }, setFieldValue: (field: string, value: string) => Promise>, @@ -345,7 +345,7 @@ const changeDuration = ( } }; -export const changeDurationHour = async ( +export const changeDurationHour = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, @@ -371,7 +371,7 @@ export const changeDurationHour = async ( setFieldValue("scheduleDurationHours", value); }; -export const changeDurationMinute = async ( +export const changeDurationMinute = ( value: string, formikValues: RequiredFormikValues & { scheduleStartDate: string | number, @@ -471,7 +471,7 @@ export const changeStartDateMultiple = ( ); }; -export const changeStartHourMultiple = async ( +export const changeStartHourMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -497,7 +497,7 @@ export const changeStartHourMultiple = async ( setFieldValue("scheduleStartHour", value); }; -export const changeStartMinuteMultiple = async ( +export const changeStartMinuteMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -524,7 +524,7 @@ export const changeStartMinuteMultiple = async ( }; // changes the end in the formik -export const changeEndDateMultiple = async ( +export const changeEndDateMultiple = ( value: string | Date, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -613,7 +613,7 @@ const changeEndMultiple = ( } }; -export const changeEndHourMultiple = async ( +export const changeEndHourMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -639,7 +639,7 @@ export const changeEndHourMultiple = async ( setFieldValue("scheduleEndHour", value); }; -export const changeEndMinuteMultiple = async ( +export const changeEndMinuteMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -709,7 +709,7 @@ const changeDurationMultiple = ( } }; -export const changeDurationHourMultiple = async ( +export const changeDurationHourMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string, @@ -736,7 +736,7 @@ export const changeDurationHourMultiple = async ( setFieldValue("scheduleDurationHours", value); }; -export const changeDurationMinuteMultiple = async ( +export const changeDurationMinuteMultiple = ( value: string, formikValues: RequiredFormikValues & { scheduleEndDate: string,