BugFix: #90,#86 + Restrictions on seller
This commit is contained in:
@@ -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 ########################################
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user