From e8e1fb7eb7d4d669381e1164aec82c14c2435bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=87=E1=85=A1=E1=86=A8=E1=84=80=E1=85=A5=E1=86=AB?= =?UTF-8?q?=E1=84=80=E1=85=B2?= Date: Fri, 4 Oct 2024 16:42:35 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EC=9A=B0=EC=84=A0=EC=A0=81=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=94=84=EB=A1=A0=ED=8A=B8=EC=97=90=EC=84=9C=20git?= =?UTF-8?q?hub=20url=EC=97=90=20=EB=8C=80=ED=95=9C=20=20validation=20?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/components/common/form/program/CreateForm.tsx | 5 +++-- FE/src/components/programEdit/EditForm.tsx | 7 ++++--- FE/src/utils/convert.ts | 6 ++++-- FE/src/utils/github.ts | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/FE/src/components/common/form/program/CreateForm.tsx b/FE/src/components/common/form/program/CreateForm.tsx index 59e0eae8..15b0f073 100644 --- a/FE/src/components/common/form/program/CreateForm.tsx +++ b/FE/src/components/common/form/program/CreateForm.tsx @@ -75,8 +75,9 @@ const CreateForm = () => { return; } - const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl); - + //TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요 + // const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl); + const isValidGithubUrl = true; if (!isValidGithubUrl) { toast.error("올바른 Github URL을 입력해주세요."); return; diff --git a/FE/src/components/programEdit/EditForm.tsx b/FE/src/components/programEdit/EditForm.tsx index 116f210b..ddfd712e 100644 --- a/FE/src/components/programEdit/EditForm.tsx +++ b/FE/src/components/programEdit/EditForm.tsx @@ -24,7 +24,7 @@ import { import { useMemberMap } from "@/hooks/useMemberForm"; import { ProgramCategory } from "@/types/program"; import { TeamInputInfo } from "@/types/team"; -import { checkIsValidateGithubUrl } from "@/utils/github"; +// import { checkIsValidateGithubUrl } from "@/utils/github"; const initialState: ProgramFormDataState = { title: "", @@ -89,8 +89,9 @@ const EditForm = ({ programId }: EditFormProps) => { return; } - const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl); - + //TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요 + // const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl); + const isValidGithubUrl = true; if (!isValidGithubUrl) { toast.error("올바른 Github URL을 입력해주세요."); return; diff --git a/FE/src/utils/convert.ts b/FE/src/utils/convert.ts index 59056e32..8393a07d 100644 --- a/FE/src/utils/convert.ts +++ b/FE/src/utils/convert.ts @@ -1,4 +1,4 @@ -import { checkIsValidateGithubUrl } from "./github"; +// import { checkIsValidateGithubUrl } from "./github"; const WEEK = ["일", "월", "화", "수", "목", "금", "토"]; @@ -25,7 +25,9 @@ export const convertText = (text: string, str: string) => { //githubUrl을 owner, repo, branch, path로 분리 export const convertGitHubUrl = (githubUrl: string) => { - const isValidateGithubUrl = checkIsValidateGithubUrl(githubUrl); + //TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요 + // const isValidateGithubUrl = checkIsValidateGithubUrl(githubUrl); + const isValidateGithubUrl = true; if (!isValidateGithubUrl) throw new Error("올바르지 않은 깃허브 url입니다."); const parsedUrl = new URL(githubUrl); diff --git a/FE/src/utils/github.ts b/FE/src/utils/github.ts index b9dc7935..3632b15d 100644 --- a/FE/src/utils/github.ts +++ b/FE/src/utils/github.ts @@ -1,3 +1,4 @@ +//TODO: githubUrl이 유효한지 검사하는 함수. 현재는 백엔드에서만 유효성 검사 하도록 수정됨. 추후에 백엔드와 논의 필요 export const checkIsValidateGithubUrl = (githubUrl: string) => { const urlPattern = /^https:\/\/github\.com\/JNU-econovation\/weekly_presentation\/tree\/(\d{4}-[12])\/(\d{4}-[12])\/((?:[AaBb][-_]?[Tt]eam))\/([1-9](st|nd|rd|th))$/;