Skip to content

Commit

Permalink
[HOTFIX]우선적으로 프론트에서 github url에 대한 validation 하지 않도록 수정 (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
geongyu09 authored Oct 4, 2024
2 parents 1e6de34 + e8e1fb7 commit 57b9bc9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions FE/src/components/common/form/program/CreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions FE/src/components/programEdit/EditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions FE/src/utils/convert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkIsValidateGithubUrl } from "./github";
// import { checkIsValidateGithubUrl } from "./github";

const WEEK = ["일", "월", "화", "수", "목", "금", "토"];

Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions FE/src/utils/github.ts
Original file line number Diff line number Diff line change
@@ -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))$/;
Expand Down

0 comments on commit 57b9bc9

Please sign in to comment.