Paginator & SQL Querries where clauses & city search

This commit is contained in:
2024-07-18 19:02:32 +02:00
parent f88eebe8d3
commit abcde3991d
30 changed files with 850 additions and 421 deletions

View File

@@ -36,32 +36,32 @@ export type ListingCategory = {
export type ListingType = BusinessListing | CommercialPropertyListing;
export type ResponseBusinessListingArray = {
data: BusinessListing[];
total: number;
results: BusinessListing[];
totalCount: number;
};
export type ResponseBusinessListing = {
data: BusinessListing;
};
export type ResponseCommercialPropertyListingArray = {
data: CommercialPropertyListing[];
total: number;
results: CommercialPropertyListing[];
totalCount: number;
};
export type ResponseCommercialPropertyListing = {
data: CommercialPropertyListing;
};
export type ResponseUsersArray = {
data: User[];
total: number;
results: User[];
totalCount: number;
};
export interface ListCriteria {
start: number;
length: number;
page: number;
pageCount: number;
city: string;
types: string[];
city: string;
prompt: string;
criteriaType: 'business' | 'commercialProperty' | 'user';
criteriaType: 'business' | 'commercialProperty' | 'broker';
}
export interface BusinessListingCriteria extends ListCriteria {
state: string;
@@ -97,7 +97,7 @@ export interface UserListingCriteria extends ListCriteria {
companyName: string;
counties: string[];
states: string[];
criteriaType: 'user';
criteriaType: 'broker';
}
export interface KeycloakUser {
@@ -224,6 +224,12 @@ export interface UploadParams {
imagePath: string;
serialId?: number;
}
export interface GeoResult {
id: number;
city: string;
state: string;
state_code: string;
}
export function isEmpty(value: any): boolean {
// Check for undefined or null
if (value === undefined || value === null) {
@@ -258,3 +264,4 @@ export function emailToDirName(email: string): string {
return normalizedEmail;
}
export const LISTINGS_PER_PAGE = 12;