Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/adapters/leasing-adapter/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { loggedAxios as axios, logger } from 'onecore-utilities'
import { AxiosError } from 'axios'
import dayjs from 'dayjs'
import querystring from 'querystring'

Check warning on line 4 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

'querystring' is defined but never used. Allowed unused vars must match /^_/u
import {
ConsumerReport,
Contact,
Expand Down Expand Up @@ -79,15 +79,15 @@

const getLeasesForPropertyId = async (
propertyId: string,
includeTerminatedLeases: string | string[] | undefined,
includeContacts: string | string[] | undefined
includeTerminatedLeases: boolean,
includeContacts: boolean
): Promise<Lease[]> => {
const query = querystring.stringify({
includeTerminatedLeases,
includeContacts,
const queryParams = new URLSearchParams({
includeTerminatedLeases: includeTerminatedLeases.toString(),
includeContacts: includeContacts.toString(),
})
const leasesResponse = await axios(
`${tenantsLeasesServiceUrl}/leases/for/propertyId/${propertyId}?${query}`
`${tenantsLeasesServiceUrl}/leases/for/propertyId/${propertyId}?${queryParams.toString()}`
)
return leasesResponse.data.content
}
Expand Down Expand Up @@ -296,7 +296,7 @@

const getApplicantsByContactCode = async (
contactCode: string
): Promise<any[] | undefined> => {

Check warning on line 299 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
try {
const response = await axios.get(
`${tenantsLeasesServiceUrl}/applicants/${contactCode}/`
Expand All @@ -310,7 +310,7 @@

const getApplicantsAndListingByContactCode = async (
contactCode: string
): Promise<any[] | undefined> => {

Check warning on line 313 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
const applicantsAndListings: ApplicantWithListing[] = []
try {
const applicantsResponse = (await getApplicantsByContactCode(
Expand All @@ -336,7 +336,7 @@
const getApplicantByContactCodeAndListingId = async (
contactCode: string,
listingId: string
): Promise<any | undefined> => {

Check warning on line 339 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
try {
return await axios.get(
`${tenantsLeasesServiceUrl}/applicants/${contactCode}/${listingId}`
Expand Down Expand Up @@ -378,7 +378,7 @@
applicantId: string,
contactCode: string,
applicationType?: 'Replace' | 'Additional'
): Promise<any> => {

Check warning on line 381 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
try {
const response = await axios.patch(
`${tenantsLeasesServiceUrl}/applicants/${applicantId}/status`,
Expand All @@ -400,7 +400,7 @@

const withdrawApplicantByManager = async (
applicantId: string
): Promise<any> => {

Check warning on line 403 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
try {
const response = await axios.patch(
`${tenantsLeasesServiceUrl}/applicants/${applicantId}/status`,
Expand All @@ -416,7 +416,7 @@
const withdrawApplicantByUser = async (
applicantId: string,
contactCode: string
): Promise<any> => {

Check warning on line 419 in src/adapters/leasing-adapter/index.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
try {
const response = await axios.patch(
`${tenantsLeasesServiceUrl}/applicants/${applicantId}/status`,
Expand Down
4 changes: 2 additions & 2 deletions src/services/work-order-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const routes = (router: KoaRouter) => {
rentalObjectId: async () => {
const leases = await leasingAdapter.getLeasesForPropertyId(
ctx.params.identifier,
ctx.query['includeTerminatedLeases'],
'true'
false,
true
)
if (leases && leases.length > 0) {
await getRentalPropertyInfoWithLeases(leases)
Expand Down
4 changes: 2 additions & 2 deletions src/services/work-order-service/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ describe('work-order-service index', () => {
expect(getRentalPropertyInfoSpy).toHaveBeenCalledWith('123-456-789')
expect(getLeasesForPropertyIdSpy).toHaveBeenCalledWith(
'123-456-789',
undefined,
'true'
false,
true
)
expect(res.body.content).toBeDefined()
})
Expand Down
Loading