Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
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
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
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
6f6e986
Merge branch 'develop' of https://github.com/PROJECT-GSMC/GSMC-front …
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
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
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
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;
};
4 changes: 2 additions & 2 deletions apps/admin/src/entities/check-post/ui/post.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"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;
}

Expand Down
3 changes: 1 addition & 2 deletions apps/admin/src/entities/score/ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client";

import { useCallback, useState } from "react";

import Checked from "@shared/asset/svg/checked";
import { useCallback, useState } from "react";

interface CheckboxProps {
check?: boolean;
Expand Down
15 changes: 8 additions & 7 deletions apps/admin/src/views/change-password/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
"use client";

import { patchPassword } from "@/shared/api/patchPassword";
import type {
ChangePasswordForm,
ChangePasswordProps,
} from "@/shared/model/changePWForm";
import ChangePassword from "@/widgets/changePassword/ui";
import { Button } from "@repo/shared/button";
import { useMutation } from "@tanstack/react-query";
import { AuthForm } from "@widgets/auth/ui";
import { useRouter } from "next/navigation";
import { useCallback } from "react";
import { useForm } from "react-hook-form";

import { patchPassword } from "@/shared/api/patchPassword";
import type { ServerResponse } from "@/shared/model/AuthForm";
import type {
ChangePasswordForm,
ChangePasswordProps,
} from "@/shared/model/changePWForm";
import type { HttpError } from "@/shared/types/error";
import ChangePassword from "@/widgets/changePassword/ui";
import { AuthForm } from "@widgets/auth/ui";


const ChangePasswordView = () => {
const router = useRouter();
Expand Down
12 changes: 4 additions & 8 deletions apps/admin/src/views/check-post/api/getPosts.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import instance from "@repo/api/axios";
import type { EvidenceResponse, postState } from "@repo/types/evidences";
import type { AxiosResponse } from "axios";
import type { PostResponse, PostStatus } from "@repo/types/evidences";

export const getPosts = async (
email: string,
status: postState | null,
): Promise<AxiosResponse<EvidenceResponse>> => {
return await instance.get<EvidenceResponse>(
`/evidence/${decodeURIComponent(email).split("@")[0]?.slice(1)}?status=${status}`,
export const getPosts = async (email: string, status: PostStatus | null) => {
return await instance.get<PostResponse>(
`/evidence/${decodeURIComponent(email).split("@")[0]?.slice(1)}?status=${status}`
);
};
10 changes: 5 additions & 5 deletions apps/admin/src/views/check-post/model/useChangeEvidenceState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { postState } from "@repo/types/evidences";
import type { PostStatus } from "@repo/types/evidences";
import { useQueryClient } from "@tanstack/react-query";
import { useCallback } from "react";
import { toast } from "sonner";
Expand All @@ -9,7 +9,7 @@ export function useChangeEvidenceState(postId: number) {
const queryClient = useQueryClient();

const updatePostState = useCallback(
async (state: postState) => {
async (state: PostStatus) => {
try {
if (postId) {
const res = await changeEvidenceState(postId, state);
Expand All @@ -28,15 +28,15 @@ export function useChangeEvidenceState(postId: number) {
toast.error("게시글 상태 변경에 실패했습니다.");
}
},
[postId, queryClient],
[postId, queryClient]
);

const handlePostState = useCallback(
(state: postState) => (e: React.MouseEvent) => {
(state: PostStatus) => (e: React.MouseEvent) => {
e.stopPropagation();
void updatePostState(state);
},
[updatePostState],
[updatePostState]
);

return { handlePostState };
Expand Down
18 changes: 15 additions & 3 deletions apps/admin/src/views/check-post/model/useGetPosts.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import type { postState } from "@repo/types/evidences";
import type { PostStatus, PostType } from "@repo/types/evidences";
import { useQuery } from "@tanstack/react-query";

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

export const useGetPosts = (email: string, status: postState | null) => {
return useQuery({
export const useGetPosts = (email: string, status: PostStatus | null) => {
const query = useQuery({
queryKey: ["posts", email, status],
queryFn: () => getPosts(email, status),
staleTime: 1000 * 60 * 5,
gcTime: 1000 * 60 * 30,
});

const posts: PostType[] = [
...(query.data?.data.majorActivityEvidence ?? []),
...(query.data?.data.humanitiesActivityEvidence ?? []),
...(query.data?.data.readingEvidence ?? []),
...(query.data?.data.otherEvidence ?? []),
];

return {
...query,
posts,
};
};
20 changes: 7 additions & 13 deletions apps/admin/src/views/detail/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import type { post, postState } from "@repo/types/evidences";
import type { PostStatus } from "@repo/types/evidences";
import { getCategoryName } from "@repo/utils/handleCategory";
import { isActivity, isOthers, isReading } from "@repo/utils/handlePost";
import Image from "next/image";
Expand All @@ -19,11 +19,12 @@ export default function DetailView() {
const { handlePostState } = useChangeEvidenceState(Number(id));
const searchParams = useSearchParams();
const email = searchParams.get("email");
const status = searchParams.get("status") as postState | null;
const status = searchParams.get("status") as PostStatus | null;

const { data: studentData, isError: isStudentError } = useGetStudent(
decodeURIComponent(String(student?.email ?? email)),
);
const { data: studentPost, isError: isPostError } = useGetPosts(
const { posts, isError: isPostError } = useGetPosts(
String(student?.email ?? email),
status,
);
Expand All @@ -42,13 +43,6 @@ export default function DetailView() {
toast.error("회원 정보를 불러오지 못했습니다.");
}

const posts: post[] = [
...(studentPost?.data.majorActivityEvidence ?? []),
...(studentPost?.data.humanitiesActivityEvidence ?? []),
...(studentPost?.data.readingEvidence ?? []),
...(studentPost?.data.otherEvidence ?? []),
];

const post = posts.find((post) => post.id === Number(id));

let title = "Title";
Expand Down Expand Up @@ -86,9 +80,9 @@ export default function DetailView() {

<main className="flex flex-col gap-12">
{post &&
isActivity(post) &&
post.imageUri != null &&
post.imageUri !== "" ? (
isActivity(post) &&
post.imageUri != null &&
post.imageUri !== "" ? (
<div className="max-h-[21.215rem] w-full aspect-video bg-slate-600">
<Image
alt={post.title}
Expand Down
14 changes: 7 additions & 7 deletions apps/admin/src/views/member/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { Button } from "@repo/shared/button";
import Card from "@repo/shared/card";
import List from "@repo/shared/list";
import type { Member } from "@repo/types/member";
import Question from "@shared/asset/svg/question";
import Header from "@shared/ui/header";
import { getMember } from "@widgets/member/api/getMember";
import { useGetMember } from "@widgets/member/model/useGetMember";
import { Filter } from "@widgets/member/ui/filter";
import { useState, useCallback } from "react";
import { toast } from "sonner";

import { getSearchedMembers } from "@/entities/member/api/getSearchedMembers";
import { useMember } from "@/entities/member/model/memberContext";
import Information from "@/widgets/member/ui/information";
import Question from "@shared/asset/svg/question";
import Header from "@shared/ui/header";
import { getMember } from "@widgets/member/api/getMember";
import { useGetMember } from "@widgets/member/model/useGetMember";
import { Filter } from "@widgets/member/ui/filter";

const MemberView = () => {
const [click, setClick] = useState<string | null>(null);
Expand Down Expand Up @@ -104,8 +104,8 @@ const MemberView = () => {
Pending={member.hasPendingEvidence}
back={Number(
String(member.grade) +
String(member.classNumber) +
String(member.number).padStart(2, "0"),
String(member.classNumber) +
String(member.number).padStart(2, "0"),
)}
className={
click === member.email
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
import instance from "@repo/api/axios";
import { isAxiosError, type AxiosResponse } from "axios";

interface FeatScoreResponse {
interface PatchScore {
categoryName: string;
value: number;
}

interface FeatScoreRequest {
categoryName: string;
value: number;
}

export const featScore = async (
export const patchScore = async (
email: string,
category: string,
score: number
): Promise<AxiosResponse<FeatScoreResponse>> => {
const data: FeatScoreRequest = {
): Promise<AxiosResponse> => {
const data: PatchScore = {
categoryName: category,
value: Number(score),
};
try {
const id = email.split("@")[0]?.slice(1);
return await instance.patch<FeatScoreResponse>(`/score/${id}`, data);
return await instance.patch<PatchScore>(`/score/${id}`, data);
} catch (error) {
if (isAxiosError(error) && error.response) {
throw error;
Expand Down
12 changes: 7 additions & 5 deletions apps/admin/src/views/score/model/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ export interface Score {
}

export interface ScoreFormType {
activity: number | null;
oneSemester: number | null;
twoSemester: number | null;
newrrow: number | null;
checkbox: boolean | undefined;
activity: number;
inAward: number;
outAward: number;
oneSemester: number;
twoSemester: number;
newrrow: number;
checkbox: boolean;
}
44 changes: 44 additions & 0 deletions apps/admin/src/views/score/model/score_category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const SCORE_CATEGORIES = {
AWARD_IN: {
value: "HUMANITIES-AWARD_CAREER-HUMANITY-IN_SCHOOL",
message: "교내인성영역관련수상",
field: "inAward",
isCheckbox: false,
},
AWARD_OUT: {
field: "outAward",
value: "HUMANITIES-AWARD_CAREER-HUMANITY-OUT_SCHOOL",
message: "교외인성영역관련수상",
isCheckbox: false,
},
ACTIVITY: {
value: "HUMANITIES-SERVICE-ACTIVITY",
message: "봉사활동",
field: "activity",
isCheckbox: false,
},
SEMESTER_1: {
value: "HUMANITIES-SERVICE-CLUB_SEMESTER_1",
message: "1학기 봉사 시간",
field: "oneSemester",
isCheckbox: false,
},
SEMESTER_2: {
value: "HUMANITIES-SERVICE-CLUB_SEMESTER_2",
message: "2학기 봉사 시간",
field: "twoSemester",
isCheckbox: false,
},
NEWRROW: {
value: "HUMANITIES-ACTIVITIES-NEWRROW_S",
message: "뉴로우 참여 횟수",
field: "newrrow",
isCheckbox: false,
},
TOEIC: {
value: "FOREIGN_LANG-ATTENDANCE-TOEIC_ACADEMY_STATUS",
message: "TOEIC 사관 학교 참여 여부",
field: "checkbox",
isCheckbox: true,
},
} as const;
Loading
Loading