Skip to content

Commit

Permalink
Rename InterestPeriods type to Periods as it contains interestPeriods
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Dec 12, 2023
1 parent 0df89ed commit abbfc78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/reservation/UserListItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "./helper";
import PickupModal from "./forms/PickupModal";
import NoInterestAfterModal from "./forms/NoInterestAfterModal";
import { InterestPeriods } from "./types";
import { Periods } from "./types";

export interface UserListItemsProps {
patron: PatronV5;
Expand Down Expand Up @@ -51,7 +51,7 @@ const UserListItems: FC<UserListItemsProps> = ({
}) => {
const t = useText();
const config = useConfig();
const interestPeriods = config<InterestPeriods>("interestPeriodsConfig", {
const interestPeriods = config<Periods>("interestPeriodsConfig", {
transformer: "jsonParse"
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/reservation/forms/NoInterestAfterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useText } from "../../../core/utils/text";
import ModalReservationFormSelect from "./ModalReservationFormSelect";
import { useConfig } from "../../../core/utils/config";
import { RequestStatus } from "../../../core/utils/types/request";
import { InterestPeriods } from "../types";
import { Periods } from "../types";

export interface PickupModalProps {
selectedInterest: number;
Expand All @@ -22,7 +22,7 @@ const NoInterestAfterModal = ({
}: PickupModalProps) => {
const t = useText();
const config = useConfig();
const interstPeriods = config<InterestPeriods>("interestPeriodsConfig", {
const interstPeriods = config<Periods>("interestPeriodsConfig", {
transformer: "jsonParse"
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/reservation/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { PeriodicalEdition } from "../material/periodical/helper";
import { ModalReservationFormTextType } from "./forms/helper";
import invalidSwitchCase from "../../core/utils/helpers/invalid-switch-case";
import { SubmitOrderStatus } from "../../core/dbc-gateway/generated/graphql";
import { InterestPeriods } from "./types";
import { Periods } from "./types";

export const isConfigValueOne = (configValue: string | undefined | string[]) =>
configValue === "1";
Expand All @@ -31,7 +31,7 @@ export const getPreferredBranch = (id: string, array: AgencyBranch[]) => {

export const getNoInterestAfter = (
days: number,
interestPeriod: InterestPeriods,
interestPeriod: Periods,
t: UseTextFunction
) => {
const interestPeriodFound = interestPeriod.interestPeriods.find(
Expand Down
2 changes: 1 addition & 1 deletion src/components/reservation/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Option } from "../Dropdown/Dropdown";

export type InterestPeriods = {
export type Periods = {
interestPeriods: Option[];
defaultInterestPeriod: Option;
};

0 comments on commit abbfc78

Please sign in to comment.