Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 프로토콜이 붙지 않은 url에 대해서 프로토콜을 붙여주는 로직 삭제 #229

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions frontend/components/applicant/applicantNode/Portfolio.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Txt from "@/components/common/Txt.component";
import { ApplicantReq } from "@/src/apis/applicant";
import { applicantDataFinder } from "@/src/functions/finder";
import { changeIntactUrl } from "@/src/utils/applicant";
import Link from "next/link";

interface PortfolioProps {
Expand All @@ -13,15 +12,15 @@ const Portfolio = ({ data }: PortfolioProps) => {

const portfolio = applicantDataFinder(data, "portfolio")
.split(regex)
.map((url: string) => changeIntactUrl(url.trim()));
.map((url: string) => url.trim());

const file = applicantDataFinder(data, "fileUrl")
.split(regex)
.map((url: string) => changeIntactUrl(url.trim()));
.map((url: string) => url.trim());

const fileUrlForPlanner = applicantDataFinder(data, "fileUrlforPlanner")
.split(regex)
.map((url: string) => changeIntactUrl(url.trim()));
.map((url: string) => url.trim());

return (
<>
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/utils/applicant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,3 @@ export const findApplicantState = (
return cardsData.find((card) => card.applicantId === applicantId)?.state
.passState;
};

export const changeIntactUrl = (url: string) => {
if (!url) return url;

if (!/^https?:\/\//.test(url)) {
return `http://${url}`;
}

return url;
};