Skip to content

Commit

Permalink
refactor: 불필요한 api(비밀번호 대조) 삭제하고 join api로 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghyeon77 committed Jan 16, 2025
1 parent 6266302 commit 917e014
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
10 changes: 0 additions & 10 deletions src/api/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ const createWorkspace = async (data: any) => {
return res;
};

const matchPassword = async ({ workspaceId, password }: PasswordCheck) => {
const res = await customAxios.post(
`/workspaces/${workspaceId}/match-password`,
{ password }
);

return res;
};

const joinWorkspace = async ({ password, workspaceId }: JoinWorkspace) => {
const formData = { password };
const res = await customAxios.post(
Expand Down Expand Up @@ -168,7 +159,6 @@ export {
startWorkspace,
leaveWorkspace,
infoWorkspace,
matchPassword,
missionsWorkspace,
postMissions,
missionsRecord,
Expand Down
26 changes: 1 addition & 25 deletions src/app/(afterLogin)/workspace-list/_components/AllGroupTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ import nextArrow from '@/../public/svgs/nextArrow.svg';
import Image from 'next/image';

import { useEffect, useState } from 'react';
import {
allWorkspaces,
alreadyIn,
joinWorkspace,
matchPassword,
} from '@/api/workspace';
import { allWorkspaces, alreadyIn, joinWorkspace } from '@/api/workspace';
import { useInfiniteQuery } from '@tanstack/react-query';
import { workspace } from '@/constants/queryKey';

Expand Down Expand Up @@ -62,25 +57,6 @@ export default function AllGroupTabs() {
},
});

// const nextDialog = async (e: any) => {
// e.preventDefault();
// try {
// const res = await matchPassword({
// workspaceId: currentWorkspaceId,
// password,
// });
// console.log(res);

// if (res?.data.sameness === true) {
// setIsFirstDialogOpen(false);
// } else {
// setError('잘못된 비밀번호입니다.');
// }
// } catch (error) {
// console.error(error);
// }
// };

const onSubmit = async (e: any) => {
e.preventDefault();
try {
Expand Down

0 comments on commit 917e014

Please sign in to comment.