Skip to content

Commit

Permalink
invoice edit: fetch receivable types by lease's service unit (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
NC-jsAhonen authored Jun 28, 2024
1 parent 85cc7b6 commit e35ea7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/leaseCreateCharge/requests.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
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<any, any, any> => {
return callApi(new Request(createUrl(`lease_create_charge/`), {
method: 'OPTIONS'
}));
};
export const fetchReceivableTypes = (): Generator<any, any, any> => {
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
}), {
Expand Down

0 comments on commit e35ea7e

Please sign in to comment.