Skip to content

Commit

Permalink
fix: useAppSelector for edit delivery result type mode (informatici#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasp authored Aug 6, 2024
1 parent 0291c2e commit b12c01c
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import React, { useEffect } from "react";
import { useAppDispatch, useAppSelector } from "libraries/hooks/redux";
import { Navigate, useLocation, useParams } from "react-router";
import { DeliveryResultTypeDTO } from "../../../../../../../generated";
import { IState } from "../../../../../../../types";
import { ApiResponse } from "../../../../../../../state/types";
import { PATHS } from "../../../../../../../consts";
import { setTypeMode, TypeMode } from "../../../../../../../state/types/config";
import { setTypeMode } from "../../../../../../../state/types/config";
import "./styles.scss";
import DeliveryResultTypeForm from "../deliveryResultTypeForm/DeliveryResultTypeForm";
import { getInitialFields } from "../deliveryResultTypeForm/consts";
Expand All @@ -17,11 +15,9 @@ export const EditDeliveryResultType = () => {
const { t } = useTranslation();
const { state }: { state: DeliveryResultTypeDTO | undefined } = useLocation();
const { code } = useParams();

const update = useAppSelector((state) => state.types.deliveryResult.update);

const mode = useSelector<IState, TypeMode>(
(state) => state.types.config.mode
);
const mode = useAppSelector((state) => state.types.config.mode);

const handleSubmit = (value: DeliveryResultTypeDTO) => {
dispatch(updateDeliveryResultType(value));
Expand Down

0 comments on commit b12c01c

Please sign in to comment.