From 2d67914f0077331614497d357c02bb19a6c76ba9 Mon Sep 17 00:00:00 2001 From: Morgan Ludtke Date: Wed, 28 Feb 2024 14:32:32 -0600 Subject: [PATCH 1/2] fix: add all of the jurisdiction data to external --- api/src/services/listing.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/services/listing.service.ts b/api/src/services/listing.service.ts index a5f0b84990..20a532ea98 100644 --- a/api/src/services/listing.service.ts +++ b/api/src/services/listing.service.ts @@ -627,7 +627,11 @@ export class ListingService implements OnModuleInit { }); } } - return JSON.stringify(listing); + // add additional jurisdiction fields for external purpose + const jurisdiction = await this.prisma.jurisdictions.findFirst({ + where: { id: listing.jurisdictions.id }, + }); + return JSON.stringify({ ...listing, jurisdictions: jurisdiction }); } /* From 6ce74ecd4d0f3c1de75716bed937d4d5c558f6fc Mon Sep 17 00:00:00 2001 From: Morgan Ludtke Date: Wed, 28 Feb 2024 16:18:12 -0600 Subject: [PATCH 2/2] fix: use correct field name --- api/src/services/listing.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/services/listing.service.ts b/api/src/services/listing.service.ts index 20a532ea98..c8d20bb426 100644 --- a/api/src/services/listing.service.ts +++ b/api/src/services/listing.service.ts @@ -631,7 +631,7 @@ export class ListingService implements OnModuleInit { const jurisdiction = await this.prisma.jurisdictions.findFirst({ where: { id: listing.jurisdictions.id }, }); - return JSON.stringify({ ...listing, jurisdictions: jurisdiction }); + return JSON.stringify({ ...listing, jurisdiction: jurisdiction }); } /*