Skip to content

Commit

Permalink
chore: Don't use template literals for a single variable, closes #122.…
Browse files Browse the repository at this point in the history
… Fix aditional -> additional.
  • Loading branch information
jpmckinney committed Dec 6, 2024
1 parent f405650 commit cc8412a
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/api/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const applicationSubmitFn = async (payload: ApplicationBaseInput) => {
return response.data;
};

export const aditionalDataSubmitFn = async (payload: ApplicationBaseInput) => {
export const additionalDataSubmitFn = async (payload: ApplicationBaseInput) => {
const response = await publicApi.post<IApplicationResponse>("applications/complete-information-request", payload);
return response.data;
};
Expand Down
8 changes: 3 additions & 5 deletions src/components/CreditLinesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,20 @@ export function CreditLinesTable({ rows, currency, isLoading, selectOption }: Cr
<TableRow>
<DataTableCell>{t("Additional Information")}</DataTableCell>
{rows.map((row) => (
<DataTableCell
key={`aditional-information-${row.id}`}
>{`${row.additional_information}`}</DataTableCell>
<DataTableCell key={`additional-information-${row.id}`}>{row.additional_information}</DataTableCell>
))}
</TableRow>
<TableRow>
<DataTableCell>{t("Interest rate")}</DataTableCell>
{rows.map((row) => (
<DataTableCell key={`interest-rate-${row.id}`}>{`${row.interest_rate}`}</DataTableCell>
<DataTableCell key={`interest-rate-${row.id}`}>{row.interest_rate}</DataTableCell>
))}
</TableRow>
<TableRow>
<DataTableCell>{t("Other fees")}</DataTableCell>
{rows.map((row) => (
<DataTableCell key={`other-fees-details-${row.id}`}>
<ReactMarkdown>{`${row.other_fees_description}`}</ReactMarkdown>
<ReactMarkdown>{row.other_fees_description}</ReactMarkdown>
</DataTableCell>
))}
</TableRow>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreditProductConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export function CreditProductConfirmation({ creditProduct, application }: Credit
{isLoan && (
<DataTableCell>{formatDateFromString(application.calculator_data.payment_start_date)}</DataTableCell>
)}
<DataTableCell>{`${creditProduct.interest_rate}`}</DataTableCell>
<DataTableCell>{creditProduct.interest_rate}</DataTableCell>
<DataTableCell>
<ReactMarkdown>{`${creditProduct.other_fees_description}`}</ReactMarkdown>
<ReactMarkdown>{creditProduct.other_fees_description}</ReactMarkdown>
</DataTableCell>
</TableRow>
</TableBody>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreditProductReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export function CreditProductReview({ application, className }: CreditProductRev
</DataTableCell>
)}
{isLoan && <DataTableCell>{formatDateFromString(application.payment_start_date)}</DataTableCell>}
<DataTableCell>{`${creditProduct.interest_rate}`}</DataTableCell>
<DataTableCell>{creditProduct.interest_rate}</DataTableCell>
<DataTableCell>
<ReactMarkdown>{`${creditProduct.other_fees_description}`}</ReactMarkdown>
<ReactMarkdown>{creditProduct.other_fees_description}</ReactMarkdown>
</DataTableCell>
</TableRow>
</TableBody>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function DataDisplay({ data, className }: DataDisplayProps) {
return (
<Box className={`flex flex-col mb-8 ${className}`}>
{Object.keys(data).map((key) => (
<Box key={`${key}`} className="flex flex-row">
<Box key={key} className="flex flex-row">
<Text className="mb-0 mr-2">{formatKey(key)}</Text>
<Text className="font-light mb-0">{formatValue(data[key])}</Text>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export function DataTable<T>({
/>
<TableBody>
{visibleRows.map((row: T, index) => (
<TableRow tabIndex={-1} key={`${String(index)}`}>
<TableRow tabIndex={-1} key={String(index)}>
{headCells.map((headCell) => (
<DataTableCell key={`${String(`${row[headCell.id]}-${index}-${headCell.id}`)}`}>
{headCell.type === "label" && renderValue(row, headCell)}
Expand Down
8 changes: 3 additions & 5 deletions src/components/LoansTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,20 @@ export function LoansTable({ rows, amountRequested, currency, isLoading, selectO
<TableRow>
<DataTableCell>{t("Additional Information")}</DataTableCell>
{rows.map((row) => (
<DataTableCell
key={`aditional-information-${row.id}`}
>{`${row.additional_information}`}</DataTableCell>
<DataTableCell key={`additional-information-${row.id}`}>{row.additional_information}</DataTableCell>
))}
</TableRow>
<TableRow>
<DataTableCell>{t("Interest rate")}</DataTableCell>
{rows.map((row) => (
<DataTableCell key={`interest-rate-${row.id}`}>{`${row.interest_rate}`}</DataTableCell>
<DataTableCell key={`interest-rate-${row.id}`}>{row.interest_rate}</DataTableCell>
))}
</TableRow>
<TableRow>
<DataTableCell>{t("Other fees")}</DataTableCell>
{rows.map((row) => (
<DataTableCell key={`other-fees-details-${row.id}`}>
<ReactMarkdown>{`${row.other_fees_description}`}</ReactMarkdown>
<ReactMarkdown>{row.other_fees_description}</ReactMarkdown>
</DataTableCell>
))}
</TableRow>
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSubmitAdditionalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axios from "axios";
import { useSnackbar } from "notistack";
import { useNavigate } from "react-router-dom";

import { aditionalDataSubmitFn } from "../api/public";
import { additionalDataSubmitFn } from "../api/public";
import { DISPATCH_ACTIONS, QUERY_KEYS } from "../constants";
import type { ApplicationBaseInput, IApplicationResponse } from "../schemas/application";
import useApplicationContext from "./useApplicationContext";
Expand All @@ -26,7 +26,7 @@ export default function useSubmitAdditionalData(): IUseSubmitAdditionalData {
unknown,
ApplicationBaseInput,
unknown
>((payload) => aditionalDataSubmitFn(payload), {
>((payload) => additionalDataSubmitFn(payload), {
onSuccess: (data) => {
queryClient.setQueryData([QUERY_KEYS.application_uuid, data.application.uuid], data);
applicationContext.dispatch({ type: DISPATCH_ACTIONS.SET_APPLICATION, payload: data });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fi/StageOne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function StageOne() {
rel="noreferrer"
label={t("View data in SECOP II")}
component={MUILink}
href={`${application?.award.source_url}`}
href={application?.award.source_url}
/>
{application && (
<ApplicationBorrowerTable allowDataVerification className="xl:w-4/5" application={application} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fi/StageThree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function StageThree() {
rel="noreferrer"
label={t("View data in SECOP II")}
component={MUILink}
href={`${application?.award.source_url}`}
href={application?.award.source_url}
/>
{application && <ApplicationAwardTable className="xl:w-4/5" application={application} />}
<div className="mt-6 md:mb-8 grid grid-cols-1 gap-4 md:flex md:gap-0">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ocp/ApplicationDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function ApplicationDetail({ application, readonly }: ApplicationDetailPr
rel="noreferrer"
label={t("View data in SECOP II")}
component={MUILink}
href={`${application.award.source_url}`}
href={application.award.source_url}
/>
<ApplicationAwardTable application={application} readonly={readonly} />
<Title type="section" className="mt-10 mb-4" label={t("Business Data")} />
Expand Down
2 changes: 1 addition & 1 deletion src/stories/switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function Switch({
const t = useT();

return (
<FormControl fullWidth className={`${fieldClassName}`}>
<FormControl fullWidth className={fieldClassName}>
<FormControlLabel
sx={{ alignItems: "flex-start" }}
control={
Expand Down

0 comments on commit cc8412a

Please sign in to comment.