plan/react-rewrite #1
@@ -55,11 +55,13 @@ export async function getScheduleDetails(
|
||||
};
|
||||
|
||||
for (let i = 0; i < params.flights.length; i++) {
|
||||
query[`flights[${i}]`] = params.flights[i]!;
|
||||
const flight = params.flights[i];
|
||||
if (flight !== undefined) query[`flights[${i}]`] = flight;
|
||||
}
|
||||
|
||||
for (let i = 0; i < params.dates.length; i++) {
|
||||
query[`dates[${i}]`] = params.dates[i]!;
|
||||
const date = params.dates[i];
|
||||
if (date !== undefined) query[`dates[${i}]`] = date;
|
||||
}
|
||||
|
||||
return client.get<IScheduleDetailsResponse>("schedule/details", query);
|
||||
|
||||
@@ -93,7 +93,7 @@ export const ScheduleSearchPage: FC<ScheduleSearchPageProps> = ({ params }) => {
|
||||
};
|
||||
const { days: calendarDays } = useScheduleCalendar(calendarParams);
|
||||
|
||||
const loading = outboundLoading || (inbound ? inboundLoading : false);
|
||||
const _loading = outboundLoading || (inbound ? inboundLoading : false);
|
||||
|
||||
// Navigation: change date via calendar
|
||||
const handleDateChange = useCallback(
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
buildScheduleDetailsSeo,
|
||||
} from "./seo.js";
|
||||
import type { ISimpleFlight, IScheduleFlightId } from "./types.js";
|
||||
import type { IFlightLeg } from "../online-board/types.js";
|
||||
|
||||
/** Stub t() that returns the key + interpolation vars for assertion. */
|
||||
function stubT(key: string, opts?: Record<string, unknown>): string {
|
||||
@@ -53,6 +52,7 @@ describe("buildScheduleStartSeo", () => {
|
||||
const result = buildScheduleStartSeo(stubT, "ru", CANONICAL);
|
||||
|
||||
expect(result.twitter).toBeDefined();
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- test assertion guards above
|
||||
expect(result.twitter!.card).toBe("summary");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user