Fix type error

pull/2060/head
Jérémy Rialland 2022-03-15 19:16:45 +01:00 committed by Johan Girod
parent 2c8c0fca5e
commit 98a8941fdf
3 changed files with 3 additions and 4 deletions

View File

@ -1,5 +1,4 @@
import { FabriqueSocialEntreprise } from '@/api/fabrique-social'
import { ApiCommuneJson } from '@/components/conversation/select/SelectCommune'
import { useEffect, useState } from 'react'
import { useDispatch } from 'react-redux'
import { useHistory } from 'react-router'

View File

@ -36,7 +36,7 @@ export async function searchCommunes(
if (!response.ok) {
return null
}
const json: Array<ApiCommuneJson> = await response.json()
const json = (await response.json()) as Array<ApiCommuneJson>
return json
.flatMap(({ codesPostaux, ...commune }) =>
codesPostaux

View File

@ -1,5 +1,5 @@
import { Action } from '@/actions/actions'
import { ApiCommuneJson } from '@/components/conversation/select/SelectCommune'
import { ApiCommuneJson, Commune } from '@/api/commune'
import { PreviousSimulation } from '@/selectors/previousSimulationSelectors'
import { DottedName } from 'modele-social'
import { defaultTo, without } from 'ramda'
@ -61,7 +61,7 @@ export type Situation = Partial<
Overwrite<
Record<DottedName, string | number | { valeur: number; unité: string }>,
{
'établissement . localisation': { objet: ApiCommuneJson }
'établissement . localisation': { objet: Commune }
'entreprise . imposition': string
année: number
}