Skip to content

Commit

Permalink
Refaktor av identhenting
Browse files Browse the repository at this point in the history
#deploy-endringsmelding-frontend
#deploy-endringsmelding-service
  • Loading branch information
stigus committed Mar 11, 2024
1 parent f7571e3 commit 2c5f1ab
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
WarningAlertstripe,
} from '@navikt/dolly-komponenter';
import _ from 'lodash';
import { Action } from '@/pages/endringsmelding-page/form/endringsmelding-form/EndringsmeldingReducer';

const Search = styled.div`
display: flex;
Expand Down Expand Up @@ -56,7 +57,7 @@ const StyledWarning = styled(WarningAlertstripe)`
width: -webkit-fill-available;
`;

export default <T extends unknown>({ labels, onChange, setMiljoer }: Props<T>) => {
export default <T extends unknown>({ labels, onChange, dispatch, setMiljoer }: Props<T>) => {
const [value, setValue] = useState('');
const [search, setSearch] = useState(null);
const [response, setResponse] = useState(null);
Expand Down Expand Up @@ -114,7 +115,10 @@ export default <T extends unknown>({ labels, onChange, setMiljoer }: Props<T>) =

useEffect(() => {
setMiljoer(response?.miljoer);
}, [response]);
error
? dispatch({ type: Action.SET_HENT_MILJOER_ERROR_ACTION })
: dispatch({ type: Action.SET_HENT_MILJOER_SUCCESS_ACTION });
}, [response, error]);

return (
<Search>
Expand Down

0 comments on commit 2c5f1ab

Please sign in to comment.