diff --git a/bizmatch-server/src/models/db.model.ts b/bizmatch-server/src/models/db.model.ts index af2a956..2142d76 100644 --- a/bizmatch-server/src/models/db.model.ts +++ b/bizmatch-server/src/models/db.model.ts @@ -153,10 +153,10 @@ export const GeoSchema = z zipCode: z.number().optional().nullable(), }) .superRefine((data, ctx) => { - if (!data.name && !data.county) { + if (!data.state) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: 'You need to select either a city or a county', + message: 'You need to select at least a state', path: ['name'], }); } diff --git a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts index 90ea8e5..14af8b6 100644 --- a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts +++ b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts @@ -149,7 +149,12 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent { } const result = [ { label: 'Category', value: this.selectOptions.getBusiness(this.listing.type) }, - { label: 'Located in', value: `${this.listing.location.name ? this.listing.location.name : this.listing.location.county}, ${this.selectOptions.getState(this.listing.location.state)}` }, + { + label: 'Located in', + value: `${this.listing.location.name ? this.listing.location.name : this.listing.location.county ? this.listing.location.county : ''} ${ + this.listing.location.name || this.listing.location.county ? ', ' : '' + }${this.selectOptions.getState(this.listing.location.state)}`, + }, { label: 'Asking Price', value: `${this.listing.price ? `$${this.listing.price.toLocaleString()}` : 'undisclosed '}` }, { label: 'Sales revenue', value: `${this.listing.salesRevenue ? `$${this.listing.salesRevenue.toLocaleString()}` : 'undisclosed '}` }, { label: 'Cash flow', value: `${this.listing.cashFlow ? `$${this.listing.cashFlow.toLocaleString()}` : 'undisclosed '}` }, diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html index b0e7a72..2aea9d2 100644 --- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html +++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html @@ -45,7 +45,9 @@

Sales revenue: {{ listing.salesRevenue | currency : 'USD' : 'symbol' : '1.0-0' }}

Net profit: {{ listing.cashFlow | currency : 'USD' : 'symbol' : '1.0-0' }}

-

Location: {{ listing.location.name ? listing.location.name : listing.location.county }}

+

+ Location: {{ listing.location.name ? listing.location.name : listing.location.county ? listing.location.county : this.selectOptions.getState(listing.location.state) }} +

Years established: {{ listing.established }}

Company logo