From 58acc2ece815f9410c13b989bc5b8b0fddafaddd Mon Sep 17 00:00:00 2001 From: Muhammad Usama <64538880+MuhammadUsama-hub@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:15:54 +0500 Subject: [PATCH 1/2] fix:app crash on reopen filters modal on applied date filters --- .../server-paginated-table/filters-button.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/components/server-paginated-table/filters-button.tsx b/src/lib/components/server-paginated-table/filters-button.tsx index fd5ca43..04e2c9c 100644 --- a/src/lib/components/server-paginated-table/filters-button.tsx +++ b/src/lib/components/server-paginated-table/filters-button.tsx @@ -3,10 +3,15 @@ import { FilterOutlined } from "@ant-design/icons"; import { useDeepCompareLayoutEffect } from "ahooks"; import { Button, DatePicker, Form, Input, Select, Switch, Tooltip } from "antd"; import { useForm } from "antd/lib/form/Form"; +import dayjs from "dayjs"; +import localeData from "dayjs/plugin/localeData"; +import weekday from "dayjs/plugin/weekday"; import { useState } from "react"; import CustomModal from "../custom-modal/custom-modal"; import ServerPaginatedSelect from "../server-paginated-select/server-paginated-select"; +dayjs.extend(weekday); +dayjs.extend(localeData); type Filter = { label: string; key: string; @@ -46,8 +51,19 @@ function RenderFilter({ filter, value, onChange }: RenderFilterProps) { { + // If a date is selected, set time to 00:00:00 for start_date and 23:59:59 for end_date + if (!date) return onChange?.(null); + if (filter.key === "start_date") { + onChange?.(date.startOf("day")); + } else if (filter.key === "end_date") { + onChange?.(date.endOf("day")); + } else { + onChange?.(date); + } + }} + value={value ? dayjs(value) : null} /> ); case "boolean": From 21b55156d2d1d699f03045084766aa8bf266a304 Mon Sep 17 00:00:00 2001 From: Muhammad Usama <64538880+MuhammadUsama-hub@users.noreply.github.com> Date: Fri, 26 Sep 2025 16:28:54 +0500 Subject: [PATCH 2/2] fixes:update the production base url url --- .env.production | 2 +- src/lib/types/openapi-fetch.d.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.env.production b/.env.production index ba57d70..f4e744b 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ -VITE_API_BASE_URL=https://be.starters.rayonstudios.com/api +VITE_API_BASE_URL==https://be.starters.rayonstudios.com/api/v1 VITE_ENV=production VITE_HCAPTCHA_SITE_KEY=cd86c190-7a30-4042-9468-018cd91ef63c \ No newline at end of file diff --git a/src/lib/types/openapi-fetch.d.ts b/src/lib/types/openapi-fetch.d.ts index a316745..dad122e 100644 --- a/src/lib/types/openapi-fetch.d.ts +++ b/src/lib/types/openapi-fetch.d.ts @@ -599,11 +599,10 @@ export interface components { error: string | null; }; /** @enum {string} */ - "SortFields_Notification.created_at_": "created_at"; - NotificationSortFields: components["schemas"]["SortFields_Notification.created_at_"]; + DefaultSortFields: "created_at" | "updated_at"; NotificationFetchList: { sortOrder?: components["schemas"]["SortOrder"]; - sortField?: components["schemas"]["NotificationSortFields"]; + sortField?: components["schemas"]["DefaultSortFields"]; /** Format: double */ limit?: number; /** Format: double */ @@ -1057,7 +1056,7 @@ export interface operations { parameters: { query?: { sortOrder?: components["schemas"]["SortOrder"]; - sortField?: components["schemas"]["NotificationSortFields"]; + sortField?: components["schemas"]["DefaultSortFields"]; limit?: number; page?: number; };