diff --git a/src/leaseCreateCharge/requests.ts b/src/leaseCreateCharge/requests.ts index cc5931c14..a34c4ae6b 100644 --- a/src/leaseCreateCharge/requests.ts +++ b/src/leaseCreateCharge/requests.ts @@ -1,7 +1,7 @@ import callApi from "../api/callApi"; import createUrl from "../api/createUrl"; import { store } from "../root/startApp"; -import { getUserActiveServiceUnit } from "../usersPermissions/selectors"; +import { getCurrentLease } from '../leases/selectors'; export const fetchAttributes = (): Generator => { return callApi(new Request(createUrl(`lease_create_charge/`), { method: 'OPTIONS' @@ -9,7 +9,8 @@ export const fetchAttributes = (): Generator => { }; export const fetchReceivableTypes = (): Generator => { const state = store.getState(); - const serviceUnit = getUserActiveServiceUnit(state); + const lease = getCurrentLease(state); + const serviceUnit = lease.service_unit; return callApi(new Request(createUrl(`receivable_type/`, { service_unit: serviceUnit.id }), {