Skip to content

Commit b307e8f

Browse files
committed
Feat/uth 236 get all parking space listings from one core (#35)
* Feat: UTH-236 Get All Parking Space Listings From OneCore Added missing functionality to filter result based on a ContactCode. Scored/internal Listings where the user doesn't have a housing contract is filtered out.
1 parent 62dcbdc commit b307e8f

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

core/src/adapters/leasing-adapter/listings.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -296,52 +296,6 @@ const createMultipleListings = async (
296296
}
297297
}
298298

299-
const createMultipleListings = async (
300-
listingsData: Array<Omit<Listing, 'id' | 'rentalObject'>>
301-
): Promise<AdapterResult<Listing[], 'partial-failure' | 'unknown'>> => {
302-
try {
303-
const response = await axios.post(
304-
`${tenantsLeasesServiceUrl}/listings/batch`,
305-
{ listings: listingsData }
306-
)
307-
308-
if (response.status === HttpStatusCode.Created) {
309-
return { ok: true, data: response.data.content }
310-
}
311-
312-
// Handle partial success (207 Multi-Status)
313-
if (response.status === 207) {
314-
logger.warn(
315-
{
316-
listingsCount: listingsData.length,
317-
responseData: response.data,
318-
},
319-
'Partial success when creating multiple listings'
320-
)
321-
return { ok: false, err: 'partial-failure' }
322-
}
323-
324-
logger.error(
325-
{
326-
status: response.status,
327-
data: response.data,
328-
listingsCount: listingsData.length,
329-
},
330-
'Unexpected response when creating multiple listings'
331-
)
332-
return { ok: false, err: 'unknown' }
333-
} catch (error) {
334-
logger.error(
335-
{
336-
error,
337-
listingsCount: listingsData.length,
338-
},
339-
'Error creating multiple listings'
340-
)
341-
return { ok: false, err: 'unknown' }
342-
}
343-
}
344-
345299
export {
346300
getActiveListingByRentalObjectCode,
347301
getListingsWithApplicants,

0 commit comments

Comments
 (0)