feat(dashboard): refactor home page to utilize TenderDashboard component

- Replaced the previous home page structure with a simplified TenderDashboard component for improved clarity and maintainability.
- Updated the .gitignore file to include IDE-specific files, ensuring a cleaner repository.
- Enhanced the useTenderListPresenter to support new parsing logic for cpv_codes in search parameters.
- Introduced a new utility function, buildQueryString, for better handling of query parameters in API requests.
This commit is contained in:
AmirReza Jamali
2026-05-18 10:59:16 +03:30
parent 76b3a4afb3
commit a238edc563
18 changed files with 2293 additions and 65 deletions
+26
View File
@@ -111,6 +111,32 @@ export const deleteEmptyKeys = (obj: Record<string, any>) => {
}
return newObj;
};
/** Serializes params with repeated keys for arrays (e.g. cpv_codes=1&cpv_codes=2). */
export const buildQueryString = (params: Record<string, any>): string => {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(params)) {
if (value === undefined || value === null || value === "") {
continue;
}
if (Array.isArray(value)) {
for (const item of value) {
if (item !== undefined && item !== null && item !== "") {
searchParams.append(key, String(item));
}
}
continue;
}
searchParams.append(key, String(value));
}
return searchParams.toString();
};
export const serializeAxiosParams = buildQueryString;
export const isValidAlpha2CountryCode = (code: string) => /^[A-Za-z]{2}$/.test(code);
export const getPaginatedRowNumber = ({