Skip to content

Commit

Permalink
fix: change naming getUserInfo to fetchUserInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
yougyung committed May 9, 2024
1 parent 820cb4e commit e7c6517
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/ui/user/user-credit-result.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getUserInfo } from '@/app/business/user/user.query';
import { fetchUserInfo } from '@/app/business/user/user.query';
import books from '@/public/assets/books.png';
import pencil from '@/public/assets/pencil.png';
import Image from 'next/image';

export default async function UserCreditResult() {
const userInfo = await getUserInfo();
const userInfo = await fetchUserInfo();

return (
<div className="flex justify-between items-center bg-zinc-100 min-h-20 rounded-lg py-1 px-8 gap-3">
Expand Down
4 changes: 2 additions & 2 deletions app/ui/user/user-info-card/user-info-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getPercentage } from '@/app/utils/chart.util';
import PieChart from '../../view/molecule/pie-chart/pie-chart';
import { getUserInfo } from '@/app/business/user/user.query';
import { fetchUserInfo } from '@/app/business/user/user.query';
import { MAJOR_NOTATION } from '@/app/utils/key/result-category.key';
import { UserInfoResponseSchema } from '@/app/business/user/user.validation';
import { z } from 'zod';
Expand All @@ -13,7 +13,7 @@ async function UserInfoCard() {
totalCredit,
takenCredit,
graduated,
} = (await getUserInfo()) as z.infer<typeof UserInfoResponseSchema>;
} = (await fetchUserInfo()) as z.infer<typeof UserInfoResponseSchema>;

const displaySeveralMajor = (notation: 'major' | 'title'): React.ReactNode => {
return majors.map((major, index) => {
Expand Down
4 changes: 2 additions & 2 deletions app/ui/user/user-info-navigator/user-info-navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Avatar from '../../view/atom/avatar/avatar';
import Button from '../../view/atom/button/button';
import { getUserInfo } from '@/app/business/user/user.query';
import { fetchUserInfo } from '@/app/business/user/user.query';

export default async function UserInfoNavigator() {
const userInfo = await getUserInfo();
const userInfo = await fetchUserInfo();

return (
<div className="flex flex-col items-center p-4 ">
Expand Down
5 changes: 2 additions & 3 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NextRequest } from 'next/server';
import { validateToken } from './app/business/user/user.command';
import { getUserInfo } from './app/business/user/user.query';
import { fetchUserInfo } from './app/business/user/user.query';

async function getAuth(request: NextRequest): Promise<{
role: 'guest' | 'user' | 'init';
Expand All @@ -24,8 +24,7 @@ async function getAuth(request: NextRequest): Promise<{

request.cookies.set('accessToken', validatedResult.accessToken);

// 유저 정보 요청
const user = await getUserInfo();
const user = await fetchUserInfo();
return {
role: user.studentName ? 'user' : 'init',
};
Expand Down

0 comments on commit e7c6517

Please sign in to comment.