Skip to content

Commit

Permalink
fix: develop -> main 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Klomachenko committed Dec 5, 2024
2 parents c699689 + 57b9bc9 commit 0d8d357
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
12 changes: 7 additions & 5 deletions FE/src/components/common/form/program/CreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ const CreateForm = () => {
return;
}

// const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl);

// if (!isValidGithubUrl) {
// toast.error("올바른 Github URL을 입력해주세요.");
// return;
// }
//TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요
// const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl);
const isValidGithubUrl = true;
if (!isValidGithubUrl) {
toast.error("올바른 Github URL을 입력해주세요.");
return;
}
const toastId = toast.loading(MESSAGE.CREATE.PENDING);

createProgramMutate(
Expand Down
12 changes: 6 additions & 6 deletions FE/src/components/programEdit/EditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ const EditForm = ({ programId }: EditFormProps) => {
return;
}

// Github URL 유효성 검사는 전부 백엔드로 위임 (#127)
//TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요
// const isValidGithubUrl = checkIsValidateGithubUrl(programGithubUrl);

// if (!isValidGithubUrl) {
// toast.error("올바른 Github URL을 입력해주세요.");
// return;
// }
const isValidGithubUrl = true;
if (!isValidGithubUrl) {
toast.error("올바른 Github URL을 입력해주세요.");
return;
}

const toastId = toast.loading(MESSAGE.EDIT.PENDING);

Expand Down
7 changes: 5 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,8 +25,11 @@ export const convertText = (text: string, str: string) => {

//githubUrl을 owner, repo, branch, path로 분리
export const convertGitHubUrl = (githubUrl: string) => {

//TODO: 백엔드에서 유효성 검사하도록 수정. 백엔드와 논의 필요
// const isValidateGithubUrl = checkIsValidateGithubUrl(githubUrl);
// if (!isValidateGithubUrl) throw new Error("올바르지 않은 깃허브 url입니다.");
const isValidateGithubUrl = true;
if (!isValidateGithubUrl) throw new Error("올바르지 않은 깃허브 url입니다.");

const parsedUrl = new URL(githubUrl);
const parts = parsedUrl.pathname.split("/").filter(Boolean);
Expand Down
3 changes: 2 additions & 1 deletion FE/src/utils/github.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//TODO: githubUrl이 유효한지 검사하는 함수. 현재는 백엔드에서만 유효성 검사 하도록 수정됨. 추후에 백엔드와 논의 필요
export const checkIsValidateGithubUrl = (githubUrl: string) => {
const urlPattern =
/^https:\/\/github\.com\/JNU-econovation\/weekly_presentation\/tree\/(\d{4}-[12])\/(\d{4}-[12])\/(A_team|B_team)\/([1-9](st|nd|rd|th))$/;
/^https:\/\/github\.com\/JNU-econovation\/weekly_presentation\/tree\/(\d{4}-[12])\/(\d{4}-[12])\/((?:[AaBb][-_]?[Tt]eam))\/([1-9](st|nd|rd|th))$/;

if (!urlPattern.test(githubUrl)) {
return false;
Expand Down

0 comments on commit 0d8d357

Please sign in to comment.