From 8157dcc37676cd459a3e1fbf0119f6620478c2a1 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Mon, 26 Aug 2024 17:38:38 +0200 Subject: [PATCH] BugFix: #90,#86 + Restrictions on seller --- .../listings/commercial-property.service.ts | 2 +- bizmatch-server/src/models/db.model.ts | 16 +- .../components/header/header.component.html | 120 +-------------- .../details-user/details-user.component.html | 138 +----------------- .../details-user/details-user.component.ts | 2 +- .../business-listings.component.html | 102 ------------- ...ommercial-property-listings.component.html | 7 +- .../app/pages/pricing/pricing.component.html | 12 +- .../app/pages/pricing/pricing.component.ts | 14 +- .../account/account.component.html | 16 +- .../subscription/account/account.component.ts | 3 +- 11 files changed, 62 insertions(+), 370 deletions(-) diff --git a/bizmatch-server/src/listings/commercial-property.service.ts b/bizmatch-server/src/listings/commercial-property.service.ts index 023c6d2..6872fc0 100644 --- a/bizmatch-server/src/listings/commercial-property.service.ts +++ b/bizmatch-server/src/listings/commercial-property.service.ts @@ -52,7 +52,7 @@ export class CommercialPropertyService { if (!user?.roles?.includes('ADMIN') ?? false) { whereConditions.push(or(eq(commercials.email, user?.username), ne(commercials.draft, true))); } - whereConditions.push(and(eq(schema.users.customerType, 'professional'))); + // whereConditions.push(and(eq(schema.users.customerType, 'professional'))); return whereConditions; } // #### Find by criteria ######################################## diff --git a/bizmatch-server/src/models/db.model.ts b/bizmatch-server/src/models/db.model.ts index ea1be25..f644d0e 100644 --- a/bizmatch-server/src/models/db.model.ts +++ b/bizmatch-server/src/models/db.model.ts @@ -104,12 +104,22 @@ const USStates = z.enum([ ]); export const AreasServedSchema = z.object({ county: z.string().optional().nullable(), - state: z.string().nonempty('State is required'), + state: z + .string() + .nullable() + .refine(val => val !== null && val !== '', { + message: 'State is required', + }), }); export const LicensedInSchema = z.object({ - registerNo: z.string().nonempty('Registration number is required'), - state: z.string().nonempty('State is required'), + state: z + .string() + .nullable() + .refine(val => val !== null && val !== '', { + message: 'State is required', + }), + registerNo: z.string().nonempty('License number is required'), }); export const GeoSchema = z.object({ name: z.string(), diff --git a/bizmatch/src/app/components/header/header.component.html b/bizmatch/src/app/components/header/header.component.html index ecb0372..c5c82dc 100644 --- a/bizmatch/src/app/components/header/header.component.html +++ b/bizmatch/src/app/components/header/header.component.html @@ -1,115 +1,3 @@ - -