Skip to content

Commit

Permalink
[영양사] 영양사 코드 삭제 (#378)
Browse files Browse the repository at this point in the history
* remove: 영양사 코드 삭제

* refactor: presignedUrl api 경로 변경
  • Loading branch information
junghaesung79 authored Jul 21, 2024
1 parent 10aff7d commit 3adc189
Show file tree
Hide file tree
Showing 30 changed files with 13 additions and 1,472 deletions.
10 changes: 0 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Routes, Route, Navigate, Outlet,
} from 'react-router-dom';
import OwnerLayout from 'layout/OwnerLayout';
import CoopLayout from 'layout/CoopLayout';
import Login from 'page/Auth/Login';
import Signup from 'page/Auth/Signup';
import AuthLayout from 'layout/AuthLayout';
Expand All @@ -14,7 +13,6 @@ import ModifyMenu from 'page/ModifyMenu';
import { Suspense } from 'react';
import Toast from 'component/common/Toast';
import { UserType } from 'model/auth';
import Coop from 'page/Coop';
import useUserTypeStore from 'store/useUserTypeStore';
import AddingEvent from 'page/ManageEvent/AddingEvent';
import ModifyEvent from 'page/ManageEvent/ModifyEvent';
Expand All @@ -34,9 +32,6 @@ function ProtectedRoute({ userTypeRequired }: ProtectedRouteProps) {
if (userType === 'OWNER') {
return <Navigate to="/owner" replace />;
}
if (userType === 'COOP') {
return <Navigate to="/coop" replace />;
}
if (userType === null) {
return <Navigate to="/login" replace />;
}
Expand Down Expand Up @@ -64,11 +59,6 @@ function App() {
<Route path="/owner/event-modify/:id" element={<ModifyEvent />} />
</Route>
</Route>
<Route element={<ProtectedRoute userTypeRequired="COOP" />}>
<Route path="/coop" element={<CoopLayout />}>
<Route path="/coop" element={<Coop />} />
</Route>
</Route>

<Route element={<AuthLayout />}>
<Route element={<ProtectedRoute userTypeRequired={null} />}>
Expand Down
20 changes: 0 additions & 20 deletions src/api/coop/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/uploadFile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export const uploadFiles = (formData: FormData) => accessClient.post('/OWNERS/up
headers: { 'Content-Type': 'multipart/form-data' },
});

export const getCoopUrl = (fileName: File) => accessClient.post<FileResponse>('/coop/upload/url', fileName);
export const getOwnerUrl = (fileName: File) => accessClient.post<FileResponse>('/owner/upload/url', fileName);
6 changes: 3 additions & 3 deletions src/component/common/Header/MobilePanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useLogout } from 'query/auth';
import usePrevPathStore from 'store/path';
import useMobileSidebar from 'component/common/Header/hooks/useMobileSidebar';
import useUserTypeStore from 'store/useUserTypeStore';
import { CATEGORY_COOP, CATEGORY_OWNER, HeaderCategory } from 'utils/constant/category';
import { CATEGORY_OWNER, HeaderCategory } from 'utils/constant/category';
import useSuspenseUser from 'utils/hooks/useSuspenseUser';
import styles from './MobilePanel.module.scss';

Expand Down Expand Up @@ -52,7 +52,7 @@ export default function MobilePanel() {
const { logout } = useLogout();
const { userType } = useUserTypeStore();

const targetCategory = userType === 'OWNER' ? CATEGORY_OWNER : CATEGORY_COOP;
const targetCategory = userType === 'OWNER' ? CATEGORY_OWNER : [];

const {
isExpanded: isMobileSidebarExpanded,
Expand All @@ -75,7 +75,7 @@ export default function MobilePanel() {
className={styles['mobile-header']}
>
<span className={styles['mobile-header__title']}>
{pathname === '/owner' || pathname === '/coop' ? (
{pathname === '/owner' ? (
<MobileLogoIcon title="코인 로고" />
) : (targetCategory
.flatMap((categoryValue) => categoryValue.submenu)
Expand Down
4 changes: 2 additions & 2 deletions src/component/common/Header/PCPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactComponent as LogoIcon } from 'assets/svg/common/koin-logo.svg';
import { Link, useNavigate } from 'react-router-dom';
import { CATEGORY_COOP, CATEGORY_OWNER, HeaderCategory } from 'utils/constant/category';
import { CATEGORY_OWNER, HeaderCategory } from 'utils/constant/category';
import cn from 'utils/ts/className';
import { useLogout } from 'query/auth';
import usePrevPathStore from 'store/path';
Expand Down Expand Up @@ -89,7 +89,7 @@ export default function PCPanel() {
const { logout } = useLogout();
const { userType } = useUserTypeStore();

const targetCategory = userType === 'OWNER' ? CATEGORY_OWNER : CATEGORY_COOP;
const targetCategory = userType === 'OWNER' ? CATEGORY_OWNER : [];

const handleLogout = () => {
logout(undefined, {
Expand Down
11 changes: 0 additions & 11 deletions src/layout/CoopLayout/index.tsx

This file was deleted.

58 changes: 0 additions & 58 deletions src/model/Coop/index.ts

This file was deleted.

7 changes: 2 additions & 5 deletions src/model/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ export type OwnerResponse = z.infer<typeof OwnerResponse>;
export const User = z.nullable(OwnerResponse);

export const UserTypeResponse = z.object({
user_type: z.union([
z.literal('OWNER'),
z.literal('COOP'),
]),
user_type: z.literal('OWNER'),
});

export type UserTypeResponse = z.infer<typeof UserTypeResponse>;

export type UserType = 'OWNER' | 'COOP' | null;
export type UserType = 'OWNER' | null;

export type User = z.infer<typeof User>;

Expand Down
54 changes: 0 additions & 54 deletions src/page/Coop/Coop.module.scss

This file was deleted.

109 changes: 0 additions & 109 deletions src/page/Coop/components/Calendar/Calendar.module.scss

This file was deleted.

Loading

0 comments on commit 3adc189

Please sign in to comment.