Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
d93c8e7
chore: lint
Dino0204 Jul 1, 2025
8fbceb6
fix: score api
Dino0204 Jul 1, 2025
36d801c
fix: score
Dino0204 Jul 1, 2025
a74b7d9
feat: 봉사활동
Dino0204 Jul 1, 2025
c857598
Merge pull request #178 from PROJECT-GSMC/fix/score
Dino0204 Jul 1, 2025
a6872d0
fix: read_a_thon
Dino0204 Jul 1, 2025
371f859
fix: calculate
Dino0204 Jul 1, 2025
5cd582a
fix: deletePost type
Dino0204 Jul 2, 2025
463e626
move: draft
Dino0204 Jul 2, 2025
b6b72c2
move: post
Dino0204 Jul 2, 2025
c4ffa16
move: currentMember
Dino0204 Jul 2, 2025
de24b44
move: httpError
Dino0204 Jul 2, 2025
c0acc2a
fix: certification
Dino0204 Jul 2, 2025
0dd55a2
fix: auth
Dino0204 Jul 2, 2025
2fc22b2
fix: posts
Dino0204 Jul 2, 2025
06cac70
fix: score
Dino0204 Jul 2, 2025
287a6a1
fix: edit
Dino0204 Jul 2, 2025
0805a0d
fix: detail
Dino0204 Jul 2, 2025
4d218aa
fix: write
Dino0204 Jul 2, 2025
ebbf1b6
fix: main
Dino0204 Jul 2, 2025
4697c5d
fix: detail
Dino0204 Jul 2, 2025
0bf74ec
chore: calculate
Dino0204 Jul 2, 2025
c400cb5
move: score_category
Dino0204 Jul 2, 2025
11eeb37
fix: OPIC 오탈자
Dino0204 Jul 2, 2025
c197d7e
chore: auth
Dino0204 Jul 2, 2025
172201e
fix: 교내외인성영역관련수상
Dino0204 Jul 3, 2025
66bea41
fix: writeCategory, editCategory, calculateCategory
Dino0204 Jul 3, 2025
6829697
fix: config type & remove others
Dino0204 Jul 3, 2025
0c39829
fix: activity
Dino0204 Jul 3, 2025
d6d5502
fix: book
Dino0204 Jul 3, 2025
b61f90a
fix: score
Dino0204 Jul 3, 2025
0436241
fix: writeConfig return
Dino0204 Jul 3, 2025
6e1dffa
fix: use mutation
Dino0204 Jul 3, 2025
dfb9ad9
fix: mockdata
Dino0204 Jul 3, 2025
0fb98b3
refactor: edit
Dino0204 Jul 3, 2025
07845c3
chore: posts
Dino0204 Jul 3, 2025
f6195b6
chore: write
Dino0204 Jul 3, 2025
7fb708f
rename: posts
Dino0204 Jul 3, 2025
7de2906
fix: detail 글 넘어감
Dino0204 Jul 3, 2025
16b67c7
fix: draft
Dino0204 Jul 3, 2025
cde163b
remove: input 계정 제한
Dino0204 Jul 3, 2025
6c7445d
fix: input 이메일 제한 제거, react-hook-form error message 사용
Dino0204 Jul 3, 2025
4f5cebc
fix: write 조건
Dino0204 Jul 3, 2025
e93999e
chore: route, category
Dino0204 Jul 3, 2025
230af6b
chore: revise
Dino0204 Jul 3, 2025
9cd58e1
fix: type, typeGuard
Dino0204 Jul 3, 2025
362943b
fix: post
Dino0204 Jul 3, 2025
54b7c1c
fix: mock
Dino0204 Jul 3, 2025
9a6229b
refactor: example
Dino0204 Jul 3, 2025
2894cd1
feat: isMockPost
Dino0204 Jul 3, 2025
e52afc7
fix: posts route
Dino0204 Jul 3, 2025
51fbd1e
refactor: delete
Dino0204 Jul 3, 2025
a96eaf9
fix: evidence types
Dino0204 Jul 4, 2025
4f42a74
feat: get score
bae080311 Jul 5, 2025
e2c546b
feat: score type
bae080311 Jul 5, 2025
e2387b5
feat: score modal
bae080311 Jul 5, 2025
1b75c3a
fix: title optional
bae080311 Jul 5, 2025
8341ad1
feat: cursor pointer
bae080311 Jul 5, 2025
71c07f9
fix: configType
Dino0204 Jul 5, 2025
7e3a2aa
fix: typeGuard
Dino0204 Jul 5, 2025
38a1a16
fix: evidence, post type
Dino0204 Jul 5, 2025
11946ba
fix: mock
Dino0204 Jul 5, 2025
ee266f0
chore: post
Dino0204 Jul 5, 2025
9fb88ae
fix: patch
Dino0204 Jul 5, 2025
d55b837
fix: post
Dino0204 Jul 5, 2025
8aadbaa
rename: handle reading
Dino0204 Jul 5, 2025
f55c0ef
chore: config
Dino0204 Jul 5, 2025
c1dd1ab
chore: getPost
Dino0204 Jul 5, 2025
0aea3a4
chore: getDraft
Dino0204 Jul 5, 2025
2d38838
move: view -> widget
Dino0204 Jul 5, 2025
15b56fe
remove: unused type
Dino0204 Jul 5, 2025
df91187
chore: posts
Dino0204 Jul 5, 2025
7329a00
chore: write
Dino0204 Jul 5, 2025
ac8d144
chore: null -> undefined
Dino0204 Jul 5, 2025
eb8f647
refactor: edit getDefaultValues
Dino0204 Jul 5, 2025
4ddcef0
fix: show category name
bae080311 Jul 6, 2025
419afea
move: edit, write config form values
Dino0204 Jul 7, 2025
7cd0953
chore: type 검사 로직
Dino0204 Jul 7, 2025
129e8eb
chore: foreign -> others
Dino0204 Jul 7, 2025
35ee4f0
fix: getDefaultValues
Dino0204 Jul 7, 2025
796c740
fix: others
Dino0204 Jul 7, 2025
5b2461d
fix: edit type 처리 로직
Dino0204 Jul 7, 2025
32952cc
fix: example postType
Dino0204 Jul 7, 2025
3f42f6b
feat: isDraft type guard
Dino0204 Jul 7, 2025
a4ed1a5
chore: formValues
Dino0204 Jul 7, 2025
1da1ea6
fix: return null
bae080311 Jul 7, 2025
125e3f2
Update README.md
Dino0204 Jul 7, 2025
6f6e986
Merge branch 'develop' of https://github.com/PROJECT-GSMC/GSMC-front …
Dino0204 Jul 7, 2025
dc19fa9
Update README.md
Dino0204 Jul 7, 2025
2379a64
rename: camelCase 사용
Dino0204 Jul 7, 2025
5400b40
Merge branch 'develop' of https://github.com/PROJECT-GSMC/GSMC-front …
Dino0204 Jul 7, 2025
ec79075
fix: use function
bae080311 Jul 7, 2025
001a137
Merge pull request #183 from PROJECT-GSMC/feat/showScore
bae080311 Jul 7, 2025
65d0773
feat: return type
Dino0204 Jul 7, 2025
a21b418
chore: lint
Dino0204 Jul 7, 2025
0477b70
fix: post type
Dino0204 Jul 7, 2025
ebd2586
fix: Image
Dino0204 Jul 7, 2025
c1abd9c
fix: type
Dino0204 Jul 7, 2025
8e5966b
fix: type
Dino0204 Jul 7, 2025
a7616cc
fix: type imports
Dino0204 Jul 7, 2025
934c31d
refactor: score_category
Dino0204 Jul 7, 2025
c69dceb
refactor: score onSubmit
Dino0204 Jul 7, 2025
3b0f018
fix: featScore type
Dino0204 Jul 7, 2025
6581ff2
rename: featScore
Dino0204 Jul 7, 2025
1e96d81
refactor: useMutation
Dino0204 Jul 7, 2025
e94b7ca
feat: isPending
Dino0204 Jul 7, 2025
e14cb0a
feat: posts
Dino0204 Jul 7, 2025
850c061
feat: drafts
Dino0204 Jul 7, 2025
47e83f3
refactor: simplify post, drafts
Dino0204 Jul 7, 2025
96b8d05
Merge pull request #182 from PROJECT-GSMC/fix/client
Dino0204 Jul 7, 2025
29d85b0
feat: eye SVG
Dino0204 Jul 8, 2025
d402404
fix: type
Dino0204 Jul 8, 2025
a3802c1
feat: eye Open & Close
Dino0204 Jul 8, 2025
c83737f
fix: input type
Dino0204 Jul 8, 2025
5f5bc47
remove: changePassword page
Dino0204 Jul 9, 2025
5e8b27c
feat: changePassword modal
Dino0204 Jul 9, 2025
ddf8350
refactor: input
Dino0204 Jul 9, 2025
439eac0
refactor: inputContainer
Dino0204 Jul 9, 2025
c2752a3
fix: response type
Dino0204 Jul 9, 2025
daf9776
fix: signin
Dino0204 Jul 9, 2025
073df8b
refactor: signup
Dino0204 Jul 9, 2025
83f2676
refactor: stepAuthcode
Dino0204 Jul 9, 2025
abf4669
refactor: stepPassword
Dino0204 Jul 9, 2025
4e59321
fix: write
Dino0204 Jul 9, 2025
4214999
remove: duplicated code
Dino0204 Jul 10, 2025
8783cf1
fix: signup onsubmit
Dino0204 Jul 10, 2025
2566efa
refactor: header
Dino0204 Jul 10, 2025
94af88a
fix: type
Dino0204 Jul 10, 2025
bb58f80
feat: isHeader
Dino0204 Jul 10, 2025
ce12b45
move: admin error
Dino0204 Jul 10, 2025
c47d27b
fix: signin, signup, changePassword type
Dino0204 Jul 10, 2025
d9386a3
fix: type
Dino0204 Jul 10, 2025
389da9d
remove: changePassword page
Dino0204 Jul 10, 2025
ba267b4
move: eye
Dino0204 Jul 10, 2025
8448250
fix: scoreForm
Dino0204 Jul 10, 2025
18ef990
refactor: signin
Dino0204 Jul 10, 2025
e39cf2f
refactor: signup
Dino0204 Jul 10, 2025
2873632
refactor: stepAuthcode
Dino0204 Jul 10, 2025
ba93c8e
refactor: stepPassword
Dino0204 Jul 10, 2025
c7eb846
fix: signin eye svg path
Dino0204 Jul 10, 2025
ff548a8
fix: edit
Dino0204 Jul 10, 2025
70096f8
fix: main
Dino0204 Jul 10, 2025
28ca458
fix: stepPassword eye svg
Dino0204 Jul 10, 2025
749f2b3
remove: 비밀번호 변경 링크
Dino0204 Jul 10, 2025
811c1c9
remove: changePassword view
Dino0204 Jul 10, 2025
8ecf4eb
fix: lint
Dino0204 Jul 10, 2025
7d5d8e1
fix: member type
Dino0204 Jul 10, 2025
4cd7724
fix: postSignin
Dino0204 Jul 10, 2025
92ba361
fix: 권한 처리
Dino0204 Jul 10, 2025
c494b63
fix: 이메일 제한 조건 수정
Dino0204 Jul 10, 2025
11c7be8
fix: type
Dino0204 Jul 10, 2025
e0c92d0
feat: 로그인 메시지
Dino0204 Jul 10, 2025
6e3739e
rename: stepAuthcode
Dino0204 Jul 10, 2025
593ed64
fix: lint
Dino0204 Jul 10, 2025
e332645
remove: placeHolder
Dino0204 Jul 11, 2025
6e9cb5a
remove: 인증번호 전송을 실패하였습니다.
Dino0204 Jul 11, 2025
095ef1e
Merge pull request #184 from PROJECT-GSMC/fix/changePassword
Dino0204 Jul 11, 2025
c3d5fee
fix: write, edit default values for controled values
Dino0204 Jul 12, 2025
123667a
fix: certificate default values for controled values
Dino0204 Jul 12, 2025
55e1ef8
feat: 임시저장 게시물 조회 시 에러 메시지 출력
Dino0204 Jul 12, 2025
c190eac
feat: 게시글 삭제 후 History API에서 삭제
Dino0204 Jul 12, 2025
fcaf677
feat: 게시글 수정 후 History 삭제
Dino0204 Jul 12, 2025
2a6a7c0
fix: button disabled cursor
Dino0204 Jul 12, 2025
810eff4
fix: 외국어 영역 파일형
Dino0204 Jul 12, 2025
41c4b2c
fix: 에러 메시지 삼항 연산자로 변경
Dino0204 Jul 13, 2025
e407039
Merge pull request #193 from PROJECT-GSMC/fix/client
Dino0204 Jul 13, 2025
90c1e4d
fix: score error handling
Dino0204 Jul 13, 2025
a8af280
feat: email -> studentCode util func
Dino0204 Jul 13, 2025
b30160d
fix: studentCode
Dino0204 Jul 13, 2025
d0239c0
fix: lint
Dino0204 Jul 13, 2025
cb77807
remove: getStudent, useGetStudent
Dino0204 Jul 13, 2025
8de371d
feat: getMember, getMembers
Dino0204 Jul 13, 2025
3193bb3
feat: useGetMember, useGetMembers
Dino0204 Jul 13, 2025
be873b0
fix: getPosts error handling
Dino0204 Jul 13, 2025
28b4567
move: getMember -> shared
Dino0204 Jul 13, 2025
ddcf1d2
fix: patchScore
Dino0204 Jul 13, 2025
0c63176
fix: detail
Dino0204 Jul 13, 2025
b8fceb7
fix: member
Dino0204 Jul 13, 2025
752d46b
fix: check-post
Dino0204 Jul 13, 2025
82058b3
fix: useChangeEvidenceStatus
Dino0204 Jul 13, 2025
2dd19cf
fix: post ui
Dino0204 Jul 13, 2025
52c7748
fix: detail ui
Dino0204 Jul 13, 2025
08b0ebd
fix: edit, detail file path
Dino0204 Jul 13, 2025
5bc08f0
fix: post height
Dino0204 Jul 13, 2025
a9abd95
feat: useChangeStatus router
Dino0204 Jul 13, 2025
bf2e236
fix: admin header
Dino0204 Jul 13, 2025
ca39c8d
feat: client component
Dino0204 Jul 13, 2025
b00ff9e
fix: header
Dino0204 Jul 13, 2025
16ee2ed
fix: score value
bae080311 Jul 13, 2025
24d4e19
Merge pull request #196 from PROJECT-GSMC/feat/showScore
bae080311 Jul 13, 2025
20b9849
fix: mock
Dino0204 Jul 13, 2025
d582cd2
feat: img align center
Dino0204 Jul 13, 2025
ad99d4c
fix: currentUserRefetch
Dino0204 Jul 13, 2025
6c9609a
feat: score animation
Dino0204 Jul 13, 2025
2427924
fix: 파일형
Dino0204 Jul 13, 2025
b325348
Merge branch 'develop' of https://github.com/PROJECT-GSMC/GSMC-front …
Dino0204 Jul 13, 2025
a465e57
feat: return type
Dino0204 Jul 13, 2025
eb1e5d3
fix: email
Dino0204 Jul 13, 2025
dca07cf
fix: list
Dino0204 Jul 13, 2025
9fe9ada
fix: scoreModal
Dino0204 Jul 13, 2025
3305fc7
fix: card
Dino0204 Jul 13, 2025
6e1bc0e
fix: certification
Dino0204 Jul 13, 2025
3582741
fix: members
Dino0204 Jul 13, 2025
5849eab
fix: header
Dino0204 Jul 13, 2025
a3ed523
feat: countUp
Dino0204 Jul 13, 2025
229b8ea
remove: loading
Dino0204 Jul 13, 2025
ceb0c96
fix: scoreModal
Dino0204 Jul 13, 2025
bdfba61
fix: list
Dino0204 Jul 13, 2025
5b960f5
fix: member error
Dino0204 Jul 13, 2025
5153a39
Merge pull request #194 from PROJECT-GSMC/fix/admin
Dino0204 Jul 13, 2025
16428fa
Merge pull request #200 from PROJECT-GSMC/develop
bae080311 Jul 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 17 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,17 @@
# Turborepo Tailwind CSS starter

This Turborepo starter is maintained by the Turborepo core team.

## Using this example

Run the following command:

```sh
npx create-turbo@latest -e with-tailwind
```

## What's inside?

This Turborepo includes the following packages/apps:

### Apps and Packages

- `docs`: a [Next.js](https://nextjs.org/) app with [Tailwind CSS](https://tailwindcss.com/)
- `web`: another [Next.js](https://nextjs.org/) app with [Tailwind CSS](https://tailwindcss.com/)
- `ui`: a stub React component library with [Tailwind CSS](https://tailwindcss.com/) shared by both `web` and `docs` applications
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

### Building packages/ui

This example is set up to produce compiled styles for `ui` components into the `dist` directory. The component `.tsx` files are consumed by the Next.js apps directly using `transpilePackages` in `next.config.ts`. This was chosen for several reasons:

- Make sharing one `tailwind.config.ts` to apps and packages as easy as possible.
- Make package compilation simple by only depending on the Next.js Compiler and `tailwindcss`.
- Ensure Tailwind classes do not overwrite each other. The `ui` package uses a `ui-` prefix for it's classes.
- Maintain clear package export boundaries.

Another option is to consume `packages/ui` directly from source without building. If using this option, you will need to update the `tailwind.config.ts` in your apps to be aware of your package locations, so it can find all usages of the `tailwindcss` class names for CSS compilation.

For example, in [tailwind.config.ts](packages/tailwind-config/tailwind.config.ts):

```js
content: [
// app content
`src/**/*.{js,ts,jsx,tsx}`,
// include packages if not transpiling
"../../packages/ui/*.{js,ts,jsx,tsx}",
],
```

If you choose this strategy, you can remove the `tailwindcss` and `autoprefixer` dependencies from the `ui` package.

### Utilities

This Turborepo has some additional tools already setup for you:

- [Tailwind CSS](https://tailwindcss.com/) for styles
- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting
# GSMC-front
GSM 인증제 관리 서비스 GSMC 입니다!

## Tech Stack
- **Next.js - V15**
- **React - V19**
- **TypeScript**
- **Tailwind CSS - V3**
- **Axios**
- **Tanstack-query**
- **React-Hook-Form**
- **ESLint**
- **Prettier**

### Architecture
- **Turborepo(Monorepo)**
- **FSD Architecture(Feature Sliced Design)**
7 changes: 0 additions & 7 deletions apps/admin/src/app/change-password/page.tsx

This file was deleted.

10 changes: 7 additions & 3 deletions apps/admin/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Header from "@/widgets/header/ui";
import { PostProvider } from "@repo/store/postProvider";
import type { Metadata } from "next";
import { Toaster } from "sonner";

import "./globals.css";
import { MemberProvider } from "@/entities/member/model/memberContext";

import Providers from "./providers";

import { MemberProvider } from "@/entities/member/model/memberContext";

export const metadata: Metadata = {
title: "GSMC",
description:
Expand All @@ -23,7 +24,10 @@ export default function RootLayout({
<body>
<MemberProvider>
<PostProvider>
<Providers>{children}</Providers>
<Providers>
<Header />
{children}
</Providers>
</PostProvider>
</MemberProvider>
<Toaster richColors />
Expand Down
6 changes: 3 additions & 3 deletions apps/admin/src/entities/check-post/api/changeEvidenceState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import instance from "@repo/api/axios";
import type { postState } from "@repo/types/evidences";
import type { PostStatus } from "@repo/types/evidences";

interface ChangeEvidenceStateResponse {
status: number;
Expand All @@ -8,11 +8,11 @@ interface ChangeEvidenceStateResponse {

export const changeEvidenceState = async (
evidenceId: number,
status: postState,
status: PostStatus
): Promise<ChangeEvidenceStateResponse> => {
const response = await instance.patch<ChangeEvidenceStateResponse>(
`/evidence/${evidenceId}/status`,
{ status },
{ status }
);
return response;
};
14 changes: 0 additions & 14 deletions apps/admin/src/entities/check-post/api/getStudent.ts

This file was deleted.

58 changes: 36 additions & 22 deletions apps/admin/src/entities/check-post/ui/post.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,61 @@
"use client";

import type { post } from "@repo/types/evidences";
import type { PostType } from "@repo/types/evidences";
import { getCategoryName } from "@repo/utils/handleCategory";
import { isActivity, isOthers, isReading } from "@repo/utils/handlePost";
import { handleState, handleStateColor } from "@repo/utils/handleState";
import Image from "next/image";

interface PostProps {
data: post;
data: PostType;
onClick?: () => void;
}

const Post = ({ data, onClick }: PostProps) => {

const title = (() => {
if ("title" in data) return data.title;
if ("evidenceType" in data) return data.evidenceType
return null;
})();

const imageUri = isActivity(data) ? data.imageUri : null;

const state = "status" in data ? data.status : null;

const subTitle = (() => {
if (isReading(data)) return `${data.author}`;
if (isOthers(data)) return getCategoryName(data.categoryName);
if (isActivity(data)) return getCategoryName(data.categoryName);
return null;
})();

return (
<article
className="flex flex-col w-[188px] cursor-pointer rounded-[0.625rem] h-[276px]"
className="flex flex-col w-[188px] cursor-pointer rounded-[0.625rem]"
onClick={onClick}
>
<div className="bg-gray-400 w-full h-[150px] rounded-t-[0.625rem] overflow-hidden">
{isActivity(data) && data.imageUri != null ? (
<div className="flex items-center justify-center bg-gray-400 w-full h-[150px] rounded-t-[0.625rem] overflow-hidden">
{imageUri == null ? null : (
<Image
alt={data.title}
className="object-cover w-[188px] h-[150px] rounded-t-[0.625rem]"
alt="gsmc"
className="object-cover rounded-t-[0.625rem]"
height={150}
src={data.imageUri}
src={imageUri}
width={188}
/>
) : null}
)}
</div>

<section className="px-[0.38rem] py-[0.75rem]">
<h3 className="text-body2 mb-[1rem] line-clamp-2">
{isActivity(data) || isReading(data) ? data.title : null}
<h3 className="text-body2 mb-[1rem] min-h-6 leading-6 line-clamp-2">
{title}
</h3>
<p className="text-gray-400 text-body5 mb-[0.75rem] line-clamp-2">
{isActivity(data) || isOthers(data)
? getCategoryName(data.categoryName)
: ("author" in data
? data.author
: "")}
<p className="text-gray-400 text-body5 mb-[0.75rem] min-h-12 leading-6 line-clamp-2">
{subTitle}
</p>
<span className={`text-body5 ${handleStateColor(data.status)}`}>
{handleState(data.status)}
</span>
{state ?
<span className={`text-body5 ${handleStateColor(state)} `}>
{handleState(state)}
</span> : null}
</section>
</article>
);
Expand Down
16 changes: 16 additions & 0 deletions apps/admin/src/entities/member/api/getScore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import instance from "@repo/api";
import { isAxiosError } from "axios";

import type { ScoreResponse } from "../model/score";

export const getScore = async (id: string): Promise<ScoreResponse> => {
try {
const res = await instance.get<ScoreResponse>(`/score/${id}`);
return res.data;
} catch (error: unknown) {
if (isAxiosError(error) && error.response) {
throw error.response.data ?? "점수 정보를 불러오는데 실패했습니다";
}
throw error;
}
};
10 changes: 10 additions & 0 deletions apps/admin/src/entities/member/model/score.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface ScoreResponse {
totalScore: number;
scores: Score[];
}

export interface Score {
categoryName: string;
value: number;
convertedValue: number;
}
13 changes: 13 additions & 0 deletions apps/admin/src/entities/member/model/useGetScore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useQuery } from "@tanstack/react-query";

import { getScore } from "../api/getScore";

import type { ScoreResponse } from "./score";

export const useGetScore = (id: string) => {
return useQuery<ScoreResponse>({
queryKey: ["score", id],
queryFn: () => getScore(id),
enabled: !!id,
});
};
40 changes: 40 additions & 0 deletions apps/admin/src/entities/member/ui/scoreModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use client";

import { Button } from "@repo/shared/button";
import Card from "@repo/shared/card";
import List from "@repo/shared/list";
import { getCategoryName } from "@repo/utils/handleCategory";

import { useGetScore } from "../model/useGetScore";

interface ScoreModalProps {
close: () => void;
show: boolean;
id: string;
}

export default function ScoreModal({ show, close, id }: ScoreModalProps) {
const { data } = useGetScore(id);
if (!show) return null;

return (
<div className="fixed inset-0 z-50 bg-[rgba(17,17,17,0.2)] flex items-center justify-center">
<article className="w-[26.25rem] h-[46.875rem] flex flex-col gap-6 bg-white rounded-[1.25rem] px-[2.45rem] py-[2.25rem]">
<h3 className="text-tropicalblue-700 text-titleSmall">
부분점수
</h3>
<List className="w-full flex-1 p-0">
{data?.scores.map((v) => (
<Card
back={v.convertedValue}
front={getCategoryName(v.categoryName).replace(/^[^-]*-/, "")}
id={v.categoryName}
key={v.categoryName}
/>
))}
</List>
<Button label="뒤로가기" variant="skyblue" onClick={close} />
</article>
</div>
);
}
34 changes: 11 additions & 23 deletions apps/admin/src/entities/signin/api/postSignin.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
import instance from "@repo/api/axios";
import { isAxiosError, type AxiosResponse } from "axios";

import type { SigninFormProps } from "@/shared/model/AuthForm";

interface SigninResponse {
accessToken: string;
refreshToken: string;
}
import type {
SigninFormProps,
SigninFormResponse,
} from "@/shared/model/signin";

export const postSignin = async (
form: SigninFormProps,
): Promise<SigninResponse> => {
form: SigninFormProps
): Promise<AxiosResponse<SigninFormResponse>> => {
try {
const response: AxiosResponse<SigninResponse> = await instance.post(
`/auth/signin`,
form,
);
return response.data;
} catch (error: unknown) {
const response = await instance.post(`/auth/signin`, form);
return response;
} catch (error) {
if (isAxiosError(error) && error.response) {
const message =
typeof error.response.data === "object" &&
error.response.data !== null &&
"message" in error.response.data
? (error.response.data as { message?: string }).message
: undefined;

throw new Error(message ?? "로그인 실패");
throw error.response.data ?? "로그인 실패";
}
throw new Error("알 수 없는 로그인 에러 발생");
throw error;
}
};
19 changes: 7 additions & 12 deletions apps/admin/src/entities/signup/api/postSignup.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import instance from "@repo/api/axios";
import { isAxiosError } from "axios";
import { isAxiosError, type AxiosResponse } from "axios";

import type { SignupFormProps } from "@/shared/model/AuthForm";

interface SignupResponse {
success: boolean;
message: string;
}
import type { SignupFormProps } from "@/shared/model/signup";

export const postSignup = async (
form: SignupFormProps,
): Promise<SignupResponse> => {
form: SignupFormProps
): Promise<AxiosResponse> => {
try {
const response = await instance.post<SignupResponse>(`/auth/signup`, form);
return response.data;
} catch (error: unknown) {
const response = await instance.post(`/auth/signup`, form);
return response;
} catch (error) {
if (isAxiosError(error) && error.response) {
throw error.response.data ?? "회원가입 실패";
}
Expand Down
Loading
Loading