diff --git a/actions/about.ts b/actions/about.ts index 276a7070d..9b6799770 100644 --- a/actions/about.ts +++ b/actions/about.ts @@ -2,6 +2,7 @@ import { revalidateTag } from 'next/cache'; +import { FutureCareers } from '@/apis/types/about'; import { putContact } from '@/apis/v2/about/contact'; import { putDirections } from '@/apis/v2/about/directions/[id]'; import { postFacility } from '@/apis/v2/about/facilities'; @@ -36,7 +37,6 @@ import { studentClubs, } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; -import { FutureCareers } from '@/types/about'; import { getPath } from '@/utils/page'; import { decodeFormDataFileName } from '@/utils/string'; diff --git a/actions/academics.ts b/actions/academics.ts index 67b923a62..044c2b5f2 100644 --- a/actions/academics.ts +++ b/actions/academics.ts @@ -2,6 +2,13 @@ import { revalidateTag } from 'next/cache'; +import { + Course, + Curriculum, + GeneralStudiesRequirement, + Scholarship, + StudentType, +} from '@/apis/types/academics'; import { deleteCourseChanges } from '@/apis/v1/academics/[studentType]/course-changes/[year]'; import { putAcademicsGuide } from '@/apis/v1/academics/[studentType]/guide'; import { @@ -28,17 +35,10 @@ import { FETCH_TAG_GUIDE, FETCH_TAG_SCHOLARSHIP, } from '@/constants/network'; +import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; import { redirect } from '@/i18n/routing'; -import { - Course, - Curriculum, - GeneralStudiesRequirement, - Scholarship, - StudentType, -} from '@/types/academics'; import { WithLanguage } from '@/types/language'; import { getPath } from '@/utils/page'; -import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; import { withErrorHandler } from './errorHandler'; diff --git a/actions/admin.ts b/actions/admin.ts index 8978a062f..b4d63f3c5 100644 --- a/actions/admin.ts +++ b/actions/admin.ts @@ -2,6 +2,7 @@ import { revalidateTag } from 'next/cache'; +import { ImportantPostIdentifier } from '@/apis/types/admin'; import { patchMultipleImportants } from '@/apis/v1/admin/important'; import { patchMultipleSlides } from '@/apis/v1/admin/slide'; import { @@ -11,7 +12,6 @@ import { FETCH_TAG_SEMINAR, FETCH_TAG_SLIDE, } from '@/constants/network'; -import { ImportantPostIdentifier } from '@/types/admin'; export const batchUnslideAction = async (ids: number[]) => { try { diff --git a/actions/news.ts b/actions/news.ts index 38c9d6933..c18844823 100644 --- a/actions/news.ts +++ b/actions/news.ts @@ -5,9 +5,9 @@ import { revalidateTag } from 'next/cache'; import { postNews } from '@/apis/v1/news'; import { deleteNews, patchNews } from '@/apis/v1/news/[id]'; import { FETCH_TAG_NEWS } from '@/constants/network'; +import { news } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const newsPath = getPath(news); diff --git a/actions/notice.ts b/actions/notice.ts index 7ffbadc89..743b07f7f 100644 --- a/actions/notice.ts +++ b/actions/notice.ts @@ -5,10 +5,10 @@ import { revalidateTag } from 'next/cache'; import { batchDeleteNotice, batchUnpinNotice, postNotice } from '@/apis/v1/notice'; import { deleteNotice, patchNotice } from '@/apis/v1/notice/[id]'; import { FETCH_TAG_NOTICE } from '@/constants/network'; +import { notice } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const noticePath = getPath(notice); diff --git a/actions/people.ts b/actions/people.ts index ba84e9d79..66d2cb481 100644 --- a/actions/people.ts +++ b/actions/people.ts @@ -2,16 +2,16 @@ import { revalidateTag } from 'next/cache'; +import { FacultyStatus } from '@/apis/types/people'; import { postFaculty } from '@/apis/v2/professor'; import { deleteFaculty, putFaculty } from '@/apis/v2/professor/[id_ko]/[id_en]'; import { postStaff } from '@/apis/v2/staff'; import { deleteStaff, putStaff } from '@/apis/v2/staff/[id_ko]/id_en'; import { FETCH_TAG_FACULTY, FETCH_TAG_STAFF } from '@/constants/network'; +import { emeritusFaculty, faculty, staff } from '@/constants/segmentNode'; import { redirect } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; -import { FacultyStatus } from '@/types/people'; import { getPath } from '@/utils/page'; -import { emeritusFaculty, faculty, staff } from '@/constants/segmentNode'; import { withErrorHandler } from './errorHandler'; diff --git a/actions/recruitment.ts b/actions/recruitment.ts index c32238286..55acb37b2 100644 --- a/actions/recruitment.ts +++ b/actions/recruitment.ts @@ -4,9 +4,9 @@ import { revalidateTag } from 'next/cache'; import { putFacultyRecruitment } from '@/apis/v1/recruit'; import { FETCH_TAG_RECRUITMENT } from '@/constants/network'; +import { facultyRecruitment } from '@/constants/segmentNode'; import { redirect } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { facultyRecruitment } from '@/constants/segmentNode'; import { withErrorHandler } from './errorHandler'; diff --git a/actions/research.ts b/actions/research.ts index 3167a02ba..ccc2307ce 100644 --- a/actions/research.ts +++ b/actions/research.ts @@ -12,10 +12,10 @@ import { import { postResearchLab } from '@/apis/v2/research/lab'; import { deleteResearchLab, putResearchLab } from '@/apis/v2/research/lab/[id_ko]/[id_en]'; import { FETCH_TAG_CENTER, FETCH_TAG_GROUP, FETCH_TAG_LAB } from '@/constants/network'; +import { researchCenters, researchGroups, researchLabs } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { WithLanguage } from '@/types/language'; import { getPath } from '@/utils/page'; -import { researchCenters, researchGroups, researchLabs } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; import { withErrorHandler } from './errorHandler'; diff --git a/actions/reservation.ts b/actions/reservation.ts index f51547305..25302d557 100644 --- a/actions/reservation.ts +++ b/actions/reservation.ts @@ -2,8 +2,8 @@ import { revalidateTag } from 'next/cache'; +import { Reservation, ReservationPostBody, ReservationPreview } from '@/apis/types/reservation'; import { FETCH_TAG_RESERVATION } from '@/constants/network'; -import { Reservation, ReservationPostBody, ReservationPreview } from '@/types/reservation'; import { deleteRequest, getRequest, postRequest } from '../apis'; import { withErrorHandler } from './errorHandler'; diff --git a/actions/seminar.ts b/actions/seminar.ts index 426dfc156..814db3551 100644 --- a/actions/seminar.ts +++ b/actions/seminar.ts @@ -5,9 +5,9 @@ import { revalidateTag } from 'next/cache'; import { postSeminar } from '@/apis/v1/seminar'; import { deleteSeminar, patchSeminar } from '@/apis/v1/seminar/[id]'; import { FETCH_TAG_SEMINAR } from '@/constants/network'; +import { seminar } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { seminar } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const seminarPath = getPath(seminar); diff --git a/types/about.ts b/apis/types/about.ts similarity index 100% rename from types/about.ts rename to apis/types/about.ts diff --git a/types/academics.ts b/apis/types/academics.ts similarity index 97% rename from types/academics.ts rename to apis/types/academics.ts index 6887ee900..a89035091 100644 --- a/types/academics.ts +++ b/apis/types/academics.ts @@ -1,6 +1,6 @@ import { Attachment } from '@/components/common/Attachments'; -import { Language } from './language'; +import { Language } from '../../types/language'; export type StudentType = 'undergraduate' | 'graduate'; diff --git a/types/admin.ts b/apis/types/admin.ts similarity index 100% rename from types/admin.ts rename to apis/types/admin.ts diff --git a/types/main.ts b/apis/types/main.ts similarity index 95% rename from types/main.ts rename to apis/types/main.ts index d7054ef26..eec24b401 100644 --- a/types/main.ts +++ b/apis/types/main.ts @@ -19,7 +19,7 @@ export type AllMainNotice = { graduate: MainNotice[]; }; -export type MainNotice = { +type MainNotice = { id: number; title: string; createdAt: string; diff --git a/types/news.ts b/apis/types/news.ts similarity index 53% rename from types/news.ts rename to apis/types/news.ts index ccebdc1fe..a0c9f00d1 100644 --- a/types/news.ts +++ b/apis/types/news.ts @@ -1,4 +1,4 @@ -export interface NewsPreview { +interface NewsPreview { id: number; title: string; description: string; @@ -40,34 +40,3 @@ export interface News { date: string; } - -export interface POSTNewsBody { - request: { - title: string; - titleForMain: string | null; - description: string; - isPrivate: boolean; - isSlide: boolean; - isImportant: boolean; - tags: string[]; - date: string; - }; - mainImage: File | null; - attachments: File[]; -} - -export interface PATCHNewsBody { - request: { - title: string; - titleForMain: string | null; - description: string; - isPrivate: boolean; - isSlide: boolean; - isImportant: boolean; - tags: string[]; - deleteIds: number[]; - date: string; - }; - mainImage: File | null; - newAttachments: File[]; -} diff --git a/types/notice.ts b/apis/types/notice.ts similarity index 57% rename from types/notice.ts rename to apis/types/notice.ts index e85512975..0cf0780c7 100644 --- a/types/notice.ts +++ b/apis/types/notice.ts @@ -36,30 +36,3 @@ export interface Notice { bytes: number; }[]; } - -export interface POSTNoticeBody { - request: { - title: string; - titleForMain: string | null; - description: string; - isPrivate: boolean; - isPinned: boolean; - isImportant: boolean; - tags: string[]; - }; - attachments: File[]; -} - -export interface PatchNoticeBody { - request: { - title: string; - titleForMain: string | null; - description: string; - isPrivate: boolean; - isPinned: boolean; - isImportant: boolean; - tags: string[]; - deleteIds: number[]; - }; - newAttachments: File[]; -} diff --git a/types/people.ts b/apis/types/people.ts similarity index 100% rename from types/people.ts rename to apis/types/people.ts diff --git a/types/post.ts b/apis/types/post.ts similarity index 100% rename from types/post.ts rename to apis/types/post.ts diff --git a/types/research.ts b/apis/types/research.ts similarity index 100% rename from types/research.ts rename to apis/types/research.ts diff --git a/types/reservation.ts b/apis/types/reservation.ts similarity index 100% rename from types/reservation.ts rename to apis/types/reservation.ts diff --git a/types/search.ts b/apis/types/search.ts similarity index 94% rename from types/search.ts rename to apis/types/search.ts index eda087810..613d8f1fe 100644 --- a/types/search.ts +++ b/apis/types/search.ts @@ -54,7 +54,7 @@ export type NewsSearchResult = { // 구성원 탭 -export type MemberType = 'PROFESSOR' | 'STAFF'; +type MemberType = 'PROFESSOR' | 'STAFF'; export type Member = { id: 0; @@ -87,7 +87,7 @@ export type ResearchSearchResult = { // 입학 탭 -export type AcademicType = +type AcademicType = | 'GUIDE' // 안내 | 'GENERAL_STUDIES_REQUIREMENTS' | 'GENERAL_STUDIES_REQUIREMENTS_SUBJECT_CHANGES' @@ -97,12 +97,12 @@ export type AcademicType = | 'COURSE_CHANGES' // 교과목변경내역 | 'SCHOLARSHIP'; // 사용 안함. PostType을 대신 사용 -export type PostType = +type PostType = | 'ACADEMICS' | 'COURSE' // 교과과정 | 'SCHOLARSHIP'; -export type StudentType = 'UNDERGRADUATE' | 'GRADUATE'; +type StudentType = 'UNDERGRADUATE' | 'GRADUATE'; export type Academic = { id: 0; diff --git a/apis/types/seminar.ts b/apis/types/seminar.ts new file mode 100644 index 000000000..ebac9c9ac --- /dev/null +++ b/apis/types/seminar.ts @@ -0,0 +1,48 @@ +export interface SeminarPreviewList { + total: number; + searchList: SeminarPreview[]; +} + +export interface SeminarPreview { + id: number; + title: string; + description: string; + name: string; + affiliation: string; + startDate: string; + location: string; + imageURL: string | null; + isYearLast: boolean; +} + +export interface Seminar { + affiliation: string | null; + affiliationURL: string | null; + attachments: { + id: number; + name: string; + url: string; + bytes: number; + }[]; + createdAt: string; + description: string | null; + endDate: string | null; + host: string | null; + id: number; + imageURL: string | null; + introduction: string | null; + isImportant: boolean; + isPrivate: boolean; + location: string; + modifiedAt: string; + name: string | null; + nextId: number | null; + nextTitle: string | null; + prevId: number | null; + prevTitle: string | null; + speakerTitle: string | null; + speakerURL: string | null; + startDate: string; + title: string; + titleForMain: string; +} diff --git a/apis/v1/about/contact.ts b/apis/v1/about/contact.ts index 865ca191a..667bbd495 100644 --- a/apis/v1/about/contact.ts +++ b/apis/v1/about/contact.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { AboutContent } from '@/apis/types/about'; import { FETCH_TAG_CONTACT } from '@/constants/network'; -import { AboutContent } from '@/types/about'; import { Language } from '@/types/language'; export const getContact = (language: Language) => diff --git a/apis/v1/about/future-careers.ts b/apis/v1/about/future-careers.ts index 720e60a81..a0a95f388 100644 --- a/apis/v1/about/future-careers.ts +++ b/apis/v1/about/future-careers.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { FutureCareers } from '@/apis/types/about'; import { FETCH_TAG_CAREER } from '@/constants/network'; -import { FutureCareers } from '@/types/about'; import { Language } from '@/types/language'; export const getFutureCareeres = (language: Language) => diff --git a/apis/v1/about/greetings.ts b/apis/v1/about/greetings.ts index 917e2871e..8a1a610c2 100644 --- a/apis/v1/about/greetings.ts +++ b/apis/v1/about/greetings.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { AboutContent } from '@/apis/types/about'; import { FETCH_TAG_GREETINGS } from '@/constants/network'; -import { AboutContent } from '@/types/about'; import { Language } from '@/types/language'; export const getGreetings = (language: Language) => diff --git a/apis/v1/about/history.ts b/apis/v1/about/history.ts index b1a4fc006..a9d650da6 100644 --- a/apis/v1/about/history.ts +++ b/apis/v1/about/history.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { AboutContent } from '@/apis/types/about'; import { FETCH_TAG_HISTORY } from '@/constants/network'; -import { AboutContent } from '@/types/about'; import { Language } from '@/types/language'; export const getHistory = (language: Language) => diff --git a/apis/v1/about/overview.ts b/apis/v1/about/overview.ts index ea35ef139..1a1a45726 100644 --- a/apis/v1/about/overview.ts +++ b/apis/v1/about/overview.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { AboutContent } from '@/apis/types/about'; import { FETCH_TAG_OVERVIEW } from '@/constants/network'; -import { AboutContent } from '@/types/about'; import { Language } from '@/types/language'; export const getOverview = (language: Language) => diff --git a/apis/v1/about/search/top.ts b/apis/v1/about/search/top.ts index cb45e9fd5..7b3bc37bc 100644 --- a/apis/v1/about/search/top.ts +++ b/apis/v1/about/search/top.ts @@ -1,5 +1,5 @@ import { getRequest } from '@/apis'; -import { AboutSearchResult, SearchParam } from '@/types/search'; +import { AboutSearchResult, SearchParam } from '@/apis/types/search'; export const searchAbout = (params: SearchParam) => getRequest('/v1/about/search/top', params) as Promise; diff --git a/apis/v1/academics/[studentType]/[postType].ts b/apis/v1/academics/[studentType]/[postType].ts index 677b33ba7..7312f7cd5 100644 --- a/apis/v1/academics/[studentType]/[postType].ts +++ b/apis/v1/academics/[studentType]/[postType].ts @@ -1,28 +1,28 @@ 'use server'; import { getRequest, postRequest, putRequest } from '@/apis'; +import { StudentType } from '@/apis/types/academics'; import { Attachment } from '@/components/common/Attachments'; -import { StudentType } from '@/types/academics'; -export interface AcademicsByPostType { +interface AcademicsByPostType { year: number; description: string; attachments: Attachment[]; } -export type PostType = 'course-changes' | 'curriculum' | 'general-studies-requirements'; +type PostType = 'course-changes' | 'curriculum' | 'general-studies-requirements'; -export const getAcademicsByPostType = (studentType: StudentType, postType: PostType) => - getRequest(`/v1/academics/${studentType}/${postType}`); +export const getAcademicsByPostType = async (studentType: StudentType, postType: PostType) => + await getRequest(`/v1/academics/${studentType}/${postType}`); -export const postAcademicsByPostType = ( +export const postAcademicsByPostType = async ( studentType: StudentType, postType: PostType, body: FormData, -) => postRequest(`/v1/academics/${studentType}/${postType}`, { body, jsessionID: true }); +) => await postRequest(`/v1/academics/${studentType}/${postType}`, { body, jsessionID: true }); -export const putAcademicsByPostType = ( +export const putAcademicsByPostType = async ( studentType: StudentType, postType: PostType, body: FormData, -) => putRequest(`/v1/academics/${studentType}/${postType}`, { body, jsessionID: true }); +) => await putRequest(`/v1/academics/${studentType}/${postType}`, { body, jsessionID: true }); diff --git a/apis/v1/academics/[studentType]/course-changes/[year].ts b/apis/v1/academics/[studentType]/course-changes/[year].ts index 40b3ccd17..b9a98dc8e 100644 --- a/apis/v1/academics/[studentType]/course-changes/[year].ts +++ b/apis/v1/academics/[studentType]/course-changes/[year].ts @@ -1,5 +1,5 @@ import { deleteRequest, putRequest } from '@/apis'; -import { StudentType } from '@/types/academics'; +import { StudentType } from '@/apis/types/academics'; export const putCourseChanges = (type: StudentType, year: number, body: FormData) => putRequest(`/v1/academics/${type}/course-changes/${year}`, { body, jsessionID: true }); diff --git a/apis/v1/academics/[studentType]/course-changes/index.ts b/apis/v1/academics/[studentType]/course-changes/index.ts index 2cc80307f..f1473679a 100644 --- a/apis/v1/academics/[studentType]/course-changes/index.ts +++ b/apis/v1/academics/[studentType]/course-changes/index.ts @@ -1,7 +1,7 @@ import { getRequest, postRequest } from '@/apis'; +import { StudentType } from '@/apis/types/academics'; import { AcademicsCommon } from '@/apis/v1/academics/types'; import { FETCH_TAG_COURSE_CHANGES } from '@/constants/network'; -import { StudentType } from '@/types/academics'; export const getCourseChanges = (type: StudentType) => getRequest(`/v1/academics/${type}/course-changes`, undefined, { diff --git a/apis/v1/academics/[studentType]/guide.ts b/apis/v1/academics/[studentType]/guide.ts index 46890d99b..788884f5c 100644 --- a/apis/v1/academics/[studentType]/guide.ts +++ b/apis/v1/academics/[studentType]/guide.ts @@ -1,6 +1,6 @@ import { getRequest, putRequest } from '@/apis'; +import { Guide, StudentType } from '@/apis/types/academics'; import { FETCH_TAG_GUIDE } from '@/constants/network'; -import { Guide, StudentType } from '@/types/academics'; export const getAcademicsGuide = (type: StudentType) => getRequest(`/v1/academics/${type}/guide`, undefined, { diff --git a/apis/v1/academics/scholarship.ts b/apis/v1/academics/scholarship.ts index 500badfa5..6c5b4ab0a 100644 --- a/apis/v1/academics/scholarship.ts +++ b/apis/v1/academics/scholarship.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { ScholarshipList, StudentType } from '@/apis/types/academics'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; -import { ScholarshipList, StudentType } from '@/types/academics'; export const getScholarshipList = (type: StudentType) => getRequest(`/v1/academics/${type}/scholarship`, undefined, { diff --git a/apis/v1/academics/search/top.ts b/apis/v1/academics/search/top.ts index 3bb3e7f7e..10e95457e 100644 --- a/apis/v1/academics/search/top.ts +++ b/apis/v1/academics/search/top.ts @@ -1,5 +1,5 @@ import { getRequest } from '@/apis'; -import { AcademicsSearchResult, SearchParam } from '@/types/search'; +import { AcademicsSearchResult, SearchParam } from '@/apis/types/search'; export const searchAcademics = (params: SearchParam) => getRequest('/v1/academics/search/top', params) as Promise; diff --git a/apis/v1/academics/undergraduate/curriculum/[year].ts b/apis/v1/academics/undergraduate/curriculum/[year].ts index 5c48c8c34..84654c26b 100644 --- a/apis/v1/academics/undergraduate/curriculum/[year].ts +++ b/apis/v1/academics/undergraduate/curriculum/[year].ts @@ -1,5 +1,5 @@ import { deleteRequest, putRequest } from '@/apis'; -import { Curriculum } from '@/types/academics'; +import { Curriculum } from '@/apis/types/academics'; export const putCurriculum = (data: Curriculum) => putRequest(`/v1/academics/undergraduate/curriculum/${data.year}`, { diff --git a/apis/v1/academics/undergraduate/curriculum/index.ts b/apis/v1/academics/undergraduate/curriculum/index.ts index 1057a0fab..2f1e96efc 100644 --- a/apis/v1/academics/undergraduate/curriculum/index.ts +++ b/apis/v1/academics/undergraduate/curriculum/index.ts @@ -1,6 +1,6 @@ import { getRequest, postRequest } from '@/apis'; +import { Curriculum } from '@/apis/types/academics'; import { FETCH_TAG_CURRICULUM } from '@/constants/network'; -import { Curriculum } from '@/types/academics'; export const getCurriculum = () => getRequest('/v1/academics/undergraduate/curriculum', undefined, { diff --git a/apis/v1/academics/undergraduate/degree-requirements.ts b/apis/v1/academics/undergraduate/degree-requirements.ts index 6660508de..450a5a28a 100644 --- a/apis/v1/academics/undergraduate/degree-requirements.ts +++ b/apis/v1/academics/undergraduate/degree-requirements.ts @@ -1,6 +1,6 @@ import { getRequest, putRequest } from '@/apis'; +import { DegreeRequirements } from '@/apis/types/academics'; import { FETCH_TAG_DEGREE } from '@/constants/network'; -import { DegreeRequirements } from '@/types/academics'; export const getDegreeRequirements = () => getRequest(`/v1/academics/undergraduate/degree-requirements`, undefined, { diff --git a/apis/v1/academics/undergraduate/general-studies-requirements/[year].ts b/apis/v1/academics/undergraduate/general-studies-requirements/[year].ts index 63797668c..fbd69facf 100644 --- a/apis/v1/academics/undergraduate/general-studies-requirements/[year].ts +++ b/apis/v1/academics/undergraduate/general-studies-requirements/[year].ts @@ -1,5 +1,5 @@ import { deleteRequest, putRequest } from '@/apis'; -import { GeneralStudiesRequirement } from '@/types/academics'; +import { GeneralStudiesRequirement } from '@/apis/types/academics'; export const putGeneralStudies = (data: GeneralStudiesRequirement) => putRequest(`/v1/academics/undergraduate/general-studies-requirements/${data.year}`, { diff --git a/apis/v1/academics/undergraduate/general-studies-requirements/index.ts b/apis/v1/academics/undergraduate/general-studies-requirements/index.ts index 3696e55df..81d6f09a9 100644 --- a/apis/v1/academics/undergraduate/general-studies-requirements/index.ts +++ b/apis/v1/academics/undergraduate/general-studies-requirements/index.ts @@ -1,6 +1,6 @@ import { getRequest, postRequest } from '@/apis'; +import { GeneralStudiesRequirement, GeneralStudiesRequirements } from '@/apis/types/academics'; import { FETCH_TAG_GENERAL_STUDIES } from '@/constants/network'; -import { GeneralStudiesRequirement, GeneralStudiesRequirements } from '@/types/academics'; export const getGeneralStudies = () => getRequest( diff --git a/apis/v1/admin/important.ts b/apis/v1/admin/important.ts index 6faba0740..46296ad62 100644 --- a/apis/v1/admin/important.ts +++ b/apis/v1/admin/important.ts @@ -1,5 +1,5 @@ import { getRequest, patchRequest } from '@/apis'; -import { ImportantPreview } from '@/types/admin'; +import { ImportantPreview } from '@/apis/types/admin'; export const getImportants = (pageNum: number) => getRequest( diff --git a/apis/v1/admin/slide.ts b/apis/v1/admin/slide.ts index f76eac5b4..25e8bb5c2 100644 --- a/apis/v1/admin/slide.ts +++ b/apis/v1/admin/slide.ts @@ -1,5 +1,5 @@ import { getRequest, patchRequest } from '@/apis'; -import { SlidePreview } from '@/types/admin'; +import { SlidePreview } from '@/apis/types/admin'; export const getSlides = (pageNum: number) => getRequest( diff --git a/apis/v1/admissions/search/top.ts b/apis/v1/admissions/search/top.ts index f2b45ce79..662f11260 100644 --- a/apis/v1/admissions/search/top.ts +++ b/apis/v1/admissions/search/top.ts @@ -1,5 +1,5 @@ import { getRequest } from '@/apis'; -import { AdmissionsSearchResult, SearchParam } from '@/types/search'; +import { AdmissionsSearchResult, SearchParam } from '@/apis/types/search'; export const searchAdmissions = (params: SearchParam) => getRequest('/v1/admissions/search/top', params) as Promise; diff --git a/apis/v1/conference/page.ts b/apis/v1/conference/page.ts index 23daa42ad..5832f178a 100644 --- a/apis/v1/conference/page.ts +++ b/apis/v1/conference/page.ts @@ -1,4 +1,4 @@ import { getRequest } from '@/apis'; -import { TopConferenceList } from '@/types/research'; +import { TopConferenceList } from '@/apis/types/research'; export const getTopConferenceList = () => getRequest('/v1/conference/page'); diff --git a/apis/v1/index.ts b/apis/v1/index.ts index 98dd2ba78..12ac10d68 100644 --- a/apis/v1/index.ts +++ b/apis/v1/index.ts @@ -1,5 +1,5 @@ +import { MainResponse } from '@/apis/types/main'; import { FETCH_TAG_NEWS, FETCH_TAG_NOTICE } from '@/constants/network'; -import { MainResponse } from '@/types/main'; import { getRequest } from '..'; diff --git a/apis/v1/member/search/top.ts b/apis/v1/member/search/top.ts index a906c9103..c92b6e0f5 100644 --- a/apis/v1/member/search/top.ts +++ b/apis/v1/member/search/top.ts @@ -1,5 +1,5 @@ import { getRequest } from '@/apis'; -import { MemberSearchResult, SearchParam } from '@/types/search'; +import { MemberSearchResult, SearchParam } from '@/apis/types/search'; export const searchMember = (params: SearchParam) => getRequest('/v1/member/search/top', params) as Promise; diff --git a/apis/v1/news/[id].ts b/apis/v1/news/[id].ts index e0d67cff8..fd7ced399 100644 --- a/apis/v1/news/[id].ts +++ b/apis/v1/news/[id].ts @@ -1,7 +1,7 @@ import { deleteRequest, getRequest, patchRequest } from '@/apis'; +import { News } from '@/apis/types/news'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { FETCH_TAG_NEWS } from '@/constants/network'; -import { News } from '@/types/news'; -import { PostSearchQueryParams } from '@/types/post'; export const getNewsDetail = (id: number, params?: PostSearchQueryParams) => getRequest(`/v1/news/${id}`, params, { diff --git a/apis/v1/news/index.ts b/apis/v1/news/index.ts index d710efa39..7e775db75 100644 --- a/apis/v1/news/index.ts +++ b/apis/v1/news/index.ts @@ -1,7 +1,7 @@ import { getRequest, postRequest } from '@/apis'; +import { NewsPreviewList } from '@/apis/types/news'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { FETCH_TAG_NEWS } from '@/constants/network'; -import { NewsPreviewList } from '@/types/news'; -import { PostSearchQueryParams } from '@/types/post'; export const getNewsPosts = (params: PostSearchQueryParams) => getRequest('/v1/news', params, { diff --git a/apis/v1/news/totalSearch.ts b/apis/v1/news/totalSearch.ts index ccdbb4842..ff14b802a 100644 --- a/apis/v1/news/totalSearch.ts +++ b/apis/v1/news/totalSearch.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { NewsSearchResult, SearchParam } from '@/apis/types/search'; import { FETCH_TAG_NEWS } from '@/constants/network'; -import { NewsSearchResult, SearchParam } from '@/types/search'; export const searchNews = (params: SearchParam) => getRequest('/v1/news/totalSearch', params, { diff --git a/apis/v1/notice/[id].ts b/apis/v1/notice/[id].ts index 74d9a63fb..b38f8d0ed 100644 --- a/apis/v1/notice/[id].ts +++ b/apis/v1/notice/[id].ts @@ -1,7 +1,7 @@ import { deleteRequest, getRequest, patchRequest } from '@/apis'; +import { Notice } from '@/apis/types/notice'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { FETCH_TAG_NOTICE } from '@/constants/network'; -import { Notice } from '@/types/notice'; -import { PostSearchQueryParams } from '@/types/post'; export const getNoticePostDetail = (id: number, params: PostSearchQueryParams) => getRequest(`/v1/notice/${id}`, params, { diff --git a/apis/v1/notice/index.ts b/apis/v1/notice/index.ts index 8350f3620..fcce97448 100644 --- a/apis/v1/notice/index.ts +++ b/apis/v1/notice/index.ts @@ -1,7 +1,7 @@ import { deleteRequest, getRequest, patchRequest, postRequest } from '@/apis'; +import { NoticePreviewList } from '@/apis/types/notice'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { FETCH_TAG_NOTICE } from '@/constants/network'; -import { NoticePreviewList } from '@/types/notice'; -import { PostSearchQueryParams } from '@/types/post'; export const getNoticePosts = (params: PostSearchQueryParams) => getRequest('/v1/notice', params, { diff --git a/apis/v1/notice/totalSearch.ts b/apis/v1/notice/totalSearch.ts index 5a2afb299..0ab842cca 100644 --- a/apis/v1/notice/totalSearch.ts +++ b/apis/v1/notice/totalSearch.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { NoticeSearchResult, SearchParam } from '@/apis/types/search'; import { FETCH_TAG_NOTICE } from '@/constants/network'; -import { NoticeSearchResult, SearchParam } from '@/types/search'; export const searchNotice = (params: SearchParam) => getRequest('/v1/notice/totalSearch', params, { diff --git a/apis/v1/recruit.ts b/apis/v1/recruit.ts index 43d5d88cf..f996febee 100644 --- a/apis/v1/recruit.ts +++ b/apis/v1/recruit.ts @@ -1,5 +1,5 @@ +import { GETFacultyRecruitmentResponse } from '@/apis/types/post'; import { FETCH_TAG_RECRUITMENT } from '@/constants/network'; -import { GETFacultyRecruitmentResponse } from '@/types/post'; import { getRequest, putRequest } from '..'; diff --git a/apis/v1/seminar/[id].ts b/apis/v1/seminar/[id].ts index 4aa15cca1..0a1ebec8c 100644 --- a/apis/v1/seminar/[id].ts +++ b/apis/v1/seminar/[id].ts @@ -1,7 +1,7 @@ import { deleteRequest, getRequest, patchRequest } from '@/apis'; +import { PostSearchQueryParams } from '@/apis/types/post'; +import { Seminar } from '@/apis/types/seminar'; import { FETCH_TAG_SEMINAR } from '@/constants/network'; -import { PostSearchQueryParams } from '@/types/post'; -import { Seminar } from '@/types/seminar'; export const getSeminarPost = async (id: number, params: PostSearchQueryParams) => { return getRequest(`/v1/seminar/${id}`, params, { diff --git a/apis/v1/seminar/index.ts b/apis/v1/seminar/index.ts index bdf95fca9..bbed09914 100644 --- a/apis/v1/seminar/index.ts +++ b/apis/v1/seminar/index.ts @@ -1,7 +1,7 @@ import { getRequest, postRequest } from '@/apis'; +import { PostSearchQueryParams } from '@/apis/types/post'; +import { SeminarPreviewList } from '@/apis/types/seminar'; import { FETCH_TAG_SEMINAR } from '@/constants/network'; -import { PostSearchQueryParams } from '@/types/post'; -import { SeminarPreviewList } from '@/types/seminar'; export const getSeminarPosts = async (params: PostSearchQueryParams) => { return getRequest('/v1/seminar', params, { diff --git a/apis/v2/about/directions/index.ts b/apis/v2/about/directions/index.ts index a57d87040..316d98e77 100644 --- a/apis/v2/about/directions/index.ts +++ b/apis/v2/about/directions/index.ts @@ -1,6 +1,6 @@ import { getRequest } from '@/apis'; +import { Direction } from '@/apis/types/about'; import { FETCH_TAG_DIRECTIONS } from '@/constants/network'; -import { Direction } from '@/types/about'; import { WithLanguage } from '@/types/language'; export const getDirections = () => diff --git a/apis/v2/about/facilities/index.ts b/apis/v2/about/facilities/index.ts index 85fd04f76..be57b95ba 100644 --- a/apis/v2/about/facilities/index.ts +++ b/apis/v2/about/facilities/index.ts @@ -1,6 +1,6 @@ import { getRequest, postRequest } from '@/apis'; +import { Facility } from '@/apis/types/about'; import { FETCH_TAG_FACILITIES } from '@/constants/network'; -import { Facility } from '@/types/about'; import { WithLanguage } from '@/types/language'; export const getFacilities = () => diff --git a/apis/v2/about/future-careers/company/[id].ts b/apis/v2/about/future-careers/company/[id].ts index a75553300..b932e3adf 100644 --- a/apis/v2/about/future-careers/company/[id].ts +++ b/apis/v2/about/future-careers/company/[id].ts @@ -1,5 +1,5 @@ import { deleteRequest, putRequest } from '@/apis'; -import { FutureCareers } from '@/types/about'; +import { FutureCareers } from '@/apis/types/about'; export const putCareerCompany = (id: number, data: FutureCareers['companies'][number]) => putRequest(`/v2/about/future-careers/company/${id}`, { diff --git a/apis/v2/about/future-careers/stats.ts b/apis/v2/about/future-careers/stats.ts index db8ac8241..abe9e645e 100644 --- a/apis/v2/about/future-careers/stats.ts +++ b/apis/v2/about/future-careers/stats.ts @@ -1,4 +1,5 @@ import { postRequest, putRequest } from '@/apis'; + import { Stat } from './types'; export interface CareerStat { diff --git a/apis/v2/about/future-careers/types.ts b/apis/v2/about/future-careers/types.ts index 80107fe38..0075ac10c 100644 --- a/apis/v2/about/future-careers/types.ts +++ b/apis/v2/about/future-careers/types.ts @@ -1,7 +1,7 @@ export const companyList = ['SAMSUNG', 'LG', 'LARGE', 'SMALL', 'GRADUATE', 'OTHER'] as const; -export type Company = (typeof companyList)[number]; +type Company = (typeof companyList)[number]; export const degreeList = ['bachelor', 'master', 'doctor'] as const; -export type Degree = (typeof degreeList)[number]; +type Degree = (typeof degreeList)[number]; export type Stat = { career: Company } & { [key in Degree]: number }; diff --git a/apis/v2/about/student-clubs/index.ts b/apis/v2/about/student-clubs/index.ts index 28b99e37a..6ef0e230b 100644 --- a/apis/v2/about/student-clubs/index.ts +++ b/apis/v2/about/student-clubs/index.ts @@ -1,6 +1,6 @@ import { getRequest, postRequest, putRequest } from '@/apis'; +import { Club } from '@/apis/types/about'; import { FETCH_TAG_CLUB } from '@/constants/network'; -import { Club } from '@/types/about'; import { WithLanguage } from '@/types/language'; export const getClubs = () => diff --git a/apis/v2/academics/[type]/scholarship/index.ts b/apis/v2/academics/[type]/scholarship/index.ts index a168e60d9..6f115d1c9 100644 --- a/apis/v2/academics/[type]/scholarship/index.ts +++ b/apis/v2/academics/[type]/scholarship/index.ts @@ -1,5 +1,5 @@ import { postRequest, putRequest } from '@/apis'; -import { StudentType } from '@/types/academics'; +import { StudentType } from '@/apis/types/academics'; export const putScholarshipGuide = (type: StudentType, description: string) => putRequest(`/v2/academics/${type}/scholarship`, { diff --git a/apis/v2/academics/courses/index.ts b/apis/v2/academics/courses/index.ts index caa28c4d5..cade13d44 100644 --- a/apis/v2/academics/courses/index.ts +++ b/apis/v2/academics/courses/index.ts @@ -1,6 +1,6 @@ import { getRequest, postRequest, putRequest } from '@/apis'; +import { Course, StudentType } from '@/apis/types/academics'; import { FETCH_TAG_COURSE } from '@/constants/network'; -import { Course, StudentType } from '@/types/academics'; import { Language } from '@/types/language'; export const getCourses = (type: StudentType, language: Language) => diff --git a/apis/v2/academics/scholarship/[id].ts b/apis/v2/academics/scholarship/[id].ts index a588e90c2..185caf173 100644 --- a/apis/v2/academics/scholarship/[id].ts +++ b/apis/v2/academics/scholarship/[id].ts @@ -1,6 +1,6 @@ import { deleteRequest, getRequest } from '@/apis'; +import { Scholarship } from '@/apis/types/academics'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; -import { Scholarship } from '@/types/academics'; import { WithLanguage } from '@/types/language'; export const getScholarship = async (id: number): Promise> => { diff --git a/apis/v2/academics/scholarship/index.ts b/apis/v2/academics/scholarship/index.ts index 015b1dbb8..e8aa554a8 100644 --- a/apis/v2/academics/scholarship/index.ts +++ b/apis/v2/academics/scholarship/index.ts @@ -1,5 +1,5 @@ import { putRequest } from '@/apis'; -import { Scholarship } from '@/types/academics'; +import { Scholarship } from '@/apis/types/academics'; import { WithLanguage } from '@/types/language'; export const putScholarship = async (id: number, data: WithLanguage) => diff --git a/apis/v2/professor/[id].ts b/apis/v2/professor/[id].ts index ca2448f14..9c6634695 100644 --- a/apis/v2/professor/[id].ts +++ b/apis/v2/professor/[id].ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { EmeritusFaculty, Faculty } from '@/apis/types/people'; import { FETCH_TAG_FACULTY } from '@/constants/network'; import { WithLanguage } from '@/types/language'; -import { EmeritusFaculty, Faculty } from '@/types/people'; // TODO: 왜 별도 함수로 있죠...? export const getFaculty = (id: number) => diff --git a/apis/v2/professor/active.ts b/apis/v2/professor/active.ts index 91d5c29d3..f2cb209da 100644 --- a/apis/v2/professor/active.ts +++ b/apis/v2/professor/active.ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { FacultyList } from '@/apis/types/people'; import { FETCH_TAG_FACULTY } from '@/constants/network'; import { Language } from '@/types/language'; -import { FacultyList } from '@/types/people'; export const getActiveFacultyList = (language: Language) => getRequest( diff --git a/apis/v2/professor/inactive.ts b/apis/v2/professor/inactive.ts index 2363561c6..e0fc1a61f 100644 --- a/apis/v2/professor/inactive.ts +++ b/apis/v2/professor/inactive.ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { SimpleEmeritusFaculty } from '@/apis/types/people'; import { FETCH_TAG_FACULTY } from '@/constants/network'; import { Language } from '@/types/language'; -import { SimpleEmeritusFaculty } from '@/types/people'; export const getEmeritusFacultyList = (language: Language) => getRequest( diff --git a/apis/v2/professor/index.ts b/apis/v2/professor/index.ts index 1ee91252f..7b354b21d 100644 --- a/apis/v2/professor/index.ts +++ b/apis/v2/professor/index.ts @@ -1,6 +1,6 @@ import { postRequest } from '@/apis'; +import { FacultyStatus } from '@/apis/types/people'; import { WithLanguage } from '@/types/language'; -import { FacultyStatus } from '@/types/people'; export const postFaculty = (formData: FormData) => postRequest('/v2/professor', { body: formData, jsessionID: true }) as Promise< diff --git a/apis/v2/research/[id].ts b/apis/v2/research/[id].ts index 8fc9f7506..573996c07 100644 --- a/apis/v2/research/[id].ts +++ b/apis/v2/research/[id].ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { ResearchCenter, ResearchGroup } from '@/apis/types/research'; import { FETCH_TAG_CENTER, FETCH_TAG_GROUP } from '@/constants/network'; import { WithLanguage } from '@/types/language'; -import { ResearchCenter, ResearchGroup } from '@/types/research'; export const getResearchGroup = (id: number) => getRequest>(`/v2/research/${id}`, undefined, { diff --git a/apis/v2/research/[id_ko]/[id_en].ts b/apis/v2/research/[id_ko]/[id_en].ts index 0898d61d2..ed826e5f8 100644 --- a/apis/v2/research/[id_ko]/[id_en].ts +++ b/apis/v2/research/[id_ko]/[id_en].ts @@ -1,6 +1,6 @@ import { deleteRequest, putRequest } from '@/apis'; +import { ResearchCenter, ResearchGroup } from '@/apis/types/research'; import { WithLanguage } from '@/types/language'; -import { ResearchCenter, ResearchGroup } from '@/types/research'; export const putResearchGroup = (ids: WithLanguage, formData: FormData) => putRequest>(`/v2/research/${ids.ko}/${ids.en}`, { diff --git a/apis/v2/research/centers.ts b/apis/v2/research/centers.ts index f9d40b65c..6dab343d7 100644 --- a/apis/v2/research/centers.ts +++ b/apis/v2/research/centers.ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { ResearchCenter } from '@/apis/types/research'; import { FETCH_TAG_CENTER } from '@/constants/network'; import { Language } from '@/types/language'; -import { ResearchCenter } from '@/types/research'; export const getResearchCenters = (language: Language) => getRequest( diff --git a/apis/v2/research/groups.ts b/apis/v2/research/groups.ts index 577aa07e2..2365f07b4 100644 --- a/apis/v2/research/groups.ts +++ b/apis/v2/research/groups.ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { ResearchGroup } from '@/apis/types/research'; import { FETCH_TAG_GROUP } from '@/constants/network'; import { Language } from '@/types/language'; -import { ResearchGroup } from '@/types/research'; export const getResearchGroups = (language: Language) => getRequest( diff --git a/apis/v2/research/index.ts b/apis/v2/research/index.ts index 77ef5e9cd..1923e2f2e 100644 --- a/apis/v2/research/index.ts +++ b/apis/v2/research/index.ts @@ -1,6 +1,6 @@ import { postRequest } from '@/apis'; +import { ResearchCenter, ResearchGroup } from '@/apis/types/research'; import { WithLanguage } from '@/types/language'; -import { ResearchCenter, ResearchGroup } from '@/types/research'; export const postResearchGroup = (formData: FormData) => postRequest>('/v2/research', { body: formData, jsessionID: true }); diff --git a/apis/v2/research/lab/[id].ts b/apis/v2/research/lab/[id].ts index 618e629bb..97f91fdfb 100644 --- a/apis/v2/research/lab/[id].ts +++ b/apis/v2/research/lab/[id].ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { ResearchLab } from '@/apis/types/research'; import { FETCH_TAG_LAB } from '@/constants/network'; import { WithLanguage } from '@/types/language'; -import { ResearchLab } from '@/types/research'; export const getResearchLab = (id: number) => getRequest>(`/v2/research/lab/${id}`, undefined, { diff --git a/apis/v2/research/lab/[id_ko]/[id_en].ts b/apis/v2/research/lab/[id_ko]/[id_en].ts index 3c1225be8..efb7cb153 100644 --- a/apis/v2/research/lab/[id_ko]/[id_en].ts +++ b/apis/v2/research/lab/[id_ko]/[id_en].ts @@ -1,6 +1,6 @@ import { deleteRequest, putRequest } from '@/apis'; +import { ResearchLab } from '@/apis/types/research'; import { WithLanguage } from '@/types/language'; -import { ResearchLab } from '@/types/research'; export const deleteResearchLab = (ids: WithLanguage) => deleteRequest(`/v2/research/lab/${ids.ko}/${ids.en}`, { jsessionID: true }); diff --git a/apis/v2/research/lab/index.ts b/apis/v2/research/lab/index.ts index 16b0778b8..a8919dd7f 100644 --- a/apis/v2/research/lab/index.ts +++ b/apis/v2/research/lab/index.ts @@ -1,7 +1,7 @@ import { getRequest, postRequest } from '@/apis'; +import { ResearchLab, SimpleResearchLab } from '@/apis/types/research'; import { FETCH_TAG_LAB } from '@/constants/network'; import { Language, WithLanguage } from '@/types/language'; -import { ResearchLab, SimpleResearchLab } from '@/types/research'; export const getResearchLabs = (language: Language) => getRequest( diff --git a/apis/v2/research/search/top.ts b/apis/v2/research/search/top.ts index 333cd4f63..024ed2493 100644 --- a/apis/v2/research/search/top.ts +++ b/apis/v2/research/search/top.ts @@ -1,5 +1,5 @@ import { getRequest } from '@/apis'; -import { ResearchSearchResult, SearchParam } from '@/types/search'; +import { ResearchSearchResult, SearchParam } from '@/apis/types/search'; export const searchResearch = (params: SearchParam) => getRequest('/v2/research/search/top', params) as Promise; diff --git a/apis/v2/staff/[id].ts b/apis/v2/staff/[id].ts index 239f5d72f..7a358dae1 100644 --- a/apis/v2/staff/[id].ts +++ b/apis/v2/staff/[id].ts @@ -1,7 +1,7 @@ import { getRequest } from '@/apis'; +import { Staff } from '@/apis/types/people'; import { FETCH_TAG_STAFF } from '@/constants/network'; import { WithLanguage } from '@/types/language'; -import { Staff } from '@/types/people'; export const getStaff = (id: number) => getRequest>(`/v2/staff/${id}`, undefined, { diff --git a/apis/v2/staff/index.ts b/apis/v2/staff/index.ts index bb36badc8..35bd76d2e 100644 --- a/apis/v2/staff/index.ts +++ b/apis/v2/staff/index.ts @@ -1,7 +1,7 @@ import { getRequest, postRequest } from '@/apis'; +import { SimpleStaff } from '@/apis/types/people'; import { FETCH_TAG_STAFF } from '@/constants/network'; import { Language, WithLanguage } from '@/types/language'; -import { SimpleStaff } from '@/types/people'; export const getStaffList = (language: Language) => getRequest('/v2/staff', { language }, { next: { tags: [FETCH_TAG_STAFF] } }); diff --git a/app/[locale]/10-10-project/manager/page.tsx b/app/[locale]/10-10-project/manager/page.tsx index a0b43acd9..4490fad76 100644 --- a/app/[locale]/10-10-project/manager/page.tsx +++ b/app/[locale]/10-10-project/manager/page.tsx @@ -1,7 +1,7 @@ import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getPath } from '@/utils/page'; import { greetings } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; export default async function TenTenManager() { return ( diff --git a/app/[locale]/about/components/AboutEditor.tsx b/app/[locale]/about/components/AboutEditor.tsx index 15fff2c17..193b84044 100644 --- a/app/[locale]/about/components/AboutEditor.tsx +++ b/app/[locale]/about/components/AboutEditor.tsx @@ -6,8 +6,8 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorFile, EditorImage } from '@/components/form/types'; import { useRouter } from '@/i18n/routing'; +import { EditorFile, EditorImage } from '@/types/form'; import { Language } from '@/types/language'; import { contentToFormData, getAttachmentDeleteIds } from '@/utils/formData'; import { handleServerResponse } from '@/utils/serverActionError'; diff --git a/app/[locale]/about/contact/page.tsx b/app/[locale]/about/contact/page.tsx index e46b80034..4481bf3d5 100644 --- a/app/[locale]/about/contact/page.tsx +++ b/app/[locale]/about/contact/page.tsx @@ -5,10 +5,10 @@ import { EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { contact } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { contact } from '@/constants/segmentNode'; interface ContactPageProps { params: Promise<{ locale: Language }>; diff --git a/app/[locale]/about/directions/DirectionsDetails.tsx b/app/[locale]/about/directions/DirectionsDetails.tsx index 8c9caae82..41b3cb2a4 100644 --- a/app/[locale]/about/directions/DirectionsDetails.tsx +++ b/app/[locale]/about/directions/DirectionsDetails.tsx @@ -1,9 +1,9 @@ +import { Direction } from '@/apis/types/about'; import { EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; -import { Direction } from '@/types/about'; -import { getPath } from '@/utils/page'; import { directions } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { replaceSpaceWithDash } from '@/utils/string'; const directionsPath = getPath(directions); diff --git a/app/[locale]/about/directions/LocationGuide.tsx b/app/[locale]/about/directions/LocationGuide.tsx index d7014c210..16c85c108 100644 --- a/app/[locale]/about/directions/LocationGuide.tsx +++ b/app/[locale]/about/directions/LocationGuide.tsx @@ -1,8 +1,8 @@ import { useTranslations } from 'next-intl'; +import { staff } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { staff } from '@/constants/segmentNode'; const staffPath = getPath(staff); diff --git a/app/[locale]/about/directions/edit/DirectionEditor.tsx b/app/[locale]/about/directions/edit/DirectionEditor.tsx index 81c99a713..0c727db7d 100644 --- a/app/[locale]/about/directions/edit/DirectionEditor.tsx +++ b/app/[locale]/about/directions/edit/DirectionEditor.tsx @@ -4,17 +4,16 @@ import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { putDirectionsAction } from '@/actions/about'; +import { Direction } from '@/apis/types/about'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { directions } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { Direction } from '@/types/about'; import { Language, WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { directions } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/about/directions/page.tsx b/app/[locale]/about/directions/page.tsx index 7a5aac8ae..40a14c68e 100644 --- a/app/[locale]/about/directions/page.tsx +++ b/app/[locale]/about/directions/page.tsx @@ -5,11 +5,11 @@ import { ReactNode } from 'react'; import { getDirections } from '@/apis/v2/about/directions'; import SelectionList from '@/components/common/selection/SelectionList'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { directions } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { findItemBySearchParam } from '@/utils/findSelectedItem'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { directions } from '@/constants/segmentNode'; import DirectionsDetails from './DirectionsDetails'; import LocationGuide from './LocationGuide'; diff --git a/app/[locale]/about/facilities/FacilitiesList.tsx b/app/[locale]/about/facilities/FacilitiesList.tsx index c8e3489f0..0a910da96 100644 --- a/app/[locale]/about/facilities/FacilitiesList.tsx +++ b/app/[locale]/about/facilities/FacilitiesList.tsx @@ -1,15 +1,15 @@ 'use client'; import { deleteFacilityAction } from '@/actions/about'; +import { Facility } from '@/apis/types/about'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import ImageWithFallback from '@/components/common/ImageWithFallback'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; +import { facilities } from '@/constants/segmentNode'; import Distance from '@/public/image/distance.svg'; -import { Facility } from '@/types/about'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { facilities } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/about/facilities/create/page.tsx b/app/[locale]/about/facilities/create/page.tsx index 67dc22553..30cdb9929 100644 --- a/app/[locale]/about/facilities/create/page.tsx +++ b/app/[locale]/about/facilities/create/page.tsx @@ -3,20 +3,19 @@ import { Fragment, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -import { postFacilityAction, putFacilityAction } from '@/actions/about'; +import { postFacilityAction } from '@/actions/about'; +import { Facility } from '@/apis/types/about'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { facilities } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { Facility } from '@/types/about'; +import { EditorImage } from '@/types/form'; import { Language, WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { facilities } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/about/facilities/edit/FacilityEditor.tsx b/app/[locale]/about/facilities/edit/FacilityEditor.tsx index bb03e5299..ba2652fcb 100644 --- a/app/[locale]/about/facilities/edit/FacilityEditor.tsx +++ b/app/[locale]/about/facilities/edit/FacilityEditor.tsx @@ -4,19 +4,18 @@ import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { putFacilityAction } from '@/actions/about'; +import { Facility } from '@/apis/types/about'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { facilities } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { Facility } from '@/types/about'; +import { EditorImage } from '@/types/form'; import { Language, WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { facilities } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/about/facilities/edit/page.tsx b/app/[locale]/about/facilities/edit/page.tsx index c60d7bfa8..c1708c08e 100644 --- a/app/[locale]/about/facilities/edit/page.tsx +++ b/app/[locale]/about/facilities/edit/page.tsx @@ -1,5 +1,6 @@ import { getFacilities } from '@/apis/v2/about/facilities'; import { findItemBySearchParam } from '@/utils/findSelectedItem'; + import FacilityEditor from './FacilityEditor'; interface FacilitiesEditPageProps { diff --git a/app/[locale]/about/facilities/page.tsx b/app/[locale]/about/facilities/page.tsx index 08e511fc2..1f0b72bb1 100644 --- a/app/[locale]/about/facilities/page.tsx +++ b/app/[locale]/about/facilities/page.tsx @@ -5,11 +5,11 @@ import FacilitesList from '@/app/[locale]/about/facilities/FacilitiesList'; import { OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { facilities } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { facilities } from '@/constants/segmentNode'; export async function generateMetadata(props: { params: Promise<{ locale: Language }> }) { const params = await props.params; diff --git a/app/[locale]/about/future-careers/CareerCompanies.tsx b/app/[locale]/about/future-careers/CareerCompanies.tsx index dc00174f4..847b6c333 100644 --- a/app/[locale]/about/future-careers/CareerCompanies.tsx +++ b/app/[locale]/about/future-careers/CareerCompanies.tsx @@ -9,10 +9,10 @@ import { postCareerCompanyAction, putCareerCompanyAction, } from '@/actions/about'; +import { FutureCareers } from '@/apis/types/about'; import { BlackButton, DeleteButton, GrayButton, OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import Form from '@/components/form/Form'; -import { FutureCareers } from '@/types/about'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; @@ -149,7 +149,7 @@ function CareerCompanyViewer({ ); } -export interface CareerCompanyFormData { +interface CareerCompanyFormData { name: string; url: string; year: number; diff --git a/app/[locale]/about/future-careers/CareerStat.tsx b/app/[locale]/about/future-careers/CareerStat.tsx index 7b94f0477..fb2827aa9 100644 --- a/app/[locale]/about/future-careers/CareerStat.tsx +++ b/app/[locale]/about/future-careers/CareerStat.tsx @@ -3,13 +3,13 @@ import { useTranslations } from 'next-intl'; import { useState } from 'react'; +import { FutureCareers } from '@/apis/types/about'; import { EditButton, OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import Dropdown from '@/components/form/legacy/Dropdown'; +import { futureCareers } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; -import { FutureCareers } from '@/types/about'; import { getPath } from '@/utils/page'; -import { futureCareers } from '@/constants/segmentNode'; export const CAREER_STAT_ROWS = ['삼성', 'LG', '기타 대기업', '중소기업', '진학', '기타']; export const CAREER_STAT_COLS = ['학부', '석사', '박사']; diff --git a/app/[locale]/about/future-careers/components/CareerStatEditor.tsx b/app/[locale]/about/future-careers/components/CareerStatEditor.tsx index 267b3d686..846e90801 100644 --- a/app/[locale]/about/future-careers/components/CareerStatEditor.tsx +++ b/app/[locale]/about/future-careers/components/CareerStatEditor.tsx @@ -1,15 +1,14 @@ 'use client'; -import { FutureCareers } from '@/types/about'; -import Fieldset from '@/components/form/Fieldset'; import { FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form'; +import { CareerStat } from '@/apis/v2/about/future-careers/stats'; +import { COMPANY_MAP, companyList, degreeList } from '@/apis/v2/about/future-careers/types'; +import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; -import { getPath } from '@/utils/page'; import { futureCareers } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { CareerStat } from '@/apis/v2/about/future-careers/stats'; -import { degreeList, companyList, COMPANY_MAP } from '@/apis/v2/about/future-careers/types'; +import { getPath } from '@/utils/page'; interface Props { defaultValues?: CareerStat; @@ -68,7 +67,7 @@ function TableBody() { return statList.map((stat, idx) => { return ( -
+
{COMPANY_MAP[stat.career]}
diff --git a/app/[locale]/about/future-careers/description/edit/CareerDescriptionEditor.tsx b/app/[locale]/about/future-careers/description/edit/CareerDescriptionEditor.tsx index 0e2387118..14d292f1d 100644 --- a/app/[locale]/about/future-careers/description/edit/CareerDescriptionEditor.tsx +++ b/app/[locale]/about/future-careers/description/edit/CareerDescriptionEditor.tsx @@ -1,20 +1,20 @@ 'use client'; +import { useState } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; + import { putCareerDescriptionAction } from '@/actions/about'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { studentClubs } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { studentClubs } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; -import { useState } from 'react'; -import { useForm, FormProvider } from 'react-hook-form'; const clubPath = getPath(studentClubs); diff --git a/app/[locale]/about/future-careers/page.tsx b/app/[locale]/about/future-careers/page.tsx index af0df238b..0452c8079 100644 --- a/app/[locale]/about/future-careers/page.tsx +++ b/app/[locale]/about/future-careers/page.tsx @@ -5,10 +5,10 @@ import { EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { futureCareers } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { futureCareers } from '@/constants/segmentNode'; import CareerCompanies from './CareerCompanies'; import CareerStat from './CareerStat'; diff --git a/app/[locale]/about/future-careers/stat/create/page.tsx b/app/[locale]/about/future-careers/stat/create/page.tsx index 3f9bac276..5ca404cc1 100644 --- a/app/[locale]/about/future-careers/stat/create/page.tsx +++ b/app/[locale]/about/future-careers/stat/create/page.tsx @@ -1,11 +1,12 @@ 'use client'; import { postCareerStatAction } from '@/actions/about'; +import { CareerStat } from '@/apis/v2/about/future-careers/stats'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; -import { CareerStat } from '@/apis/v2/about/future-careers/stats'; + import CareerStatEditor from '../../components/CareerStatEditor'; export default function CareerStatCreatePage() { diff --git a/app/[locale]/about/future-careers/stat/edit/CareerStatEditPageContent.tsx b/app/[locale]/about/future-careers/stat/edit/CareerStatEditPageContent.tsx index f195c9ddc..782b1eb94 100644 --- a/app/[locale]/about/future-careers/stat/edit/CareerStatEditPageContent.tsx +++ b/app/[locale]/about/future-careers/stat/edit/CareerStatEditPageContent.tsx @@ -1,17 +1,15 @@ 'use client'; import { putCareerStatAction } from '@/actions/about'; +import { FutureCareers } from '@/apis/types/about'; import { CareerStat } from '@/apis/v2/about/future-careers/stats'; +import { COMPANY_MAP, companyList } from '@/apis/v2/about/future-careers/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { useRouter } from '@/i18n/routing'; -import { FutureCareers } from '@/types/about'; import { errorToStr } from '@/utils/error'; -import { getPath } from '@/utils/page'; -import { futureCareers } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; + import CareerStatEditor from '../../components/CareerStatEditor'; -import { COMPANY_MAP, companyList } from '@/apis/v2/about/future-careers/types'; export default function CareerStatEditPageContent({ data, diff --git a/app/[locale]/about/history/page.tsx b/app/[locale]/about/history/page.tsx index fb42984d8..c1cfa596d 100644 --- a/app/[locale]/about/history/page.tsx +++ b/app/[locale]/about/history/page.tsx @@ -5,11 +5,11 @@ import { EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { history } from '@/constants/segmentNode'; import history_image from '@/public/image/about/history.png'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { history } from '@/constants/segmentNode'; interface HistoryPageProps { params: Promise<{ locale: Language }>; diff --git a/app/[locale]/about/overview/edit/page.tsx b/app/[locale]/about/overview/edit/page.tsx index 70a4ff313..3baed1c90 100644 --- a/app/[locale]/about/overview/edit/page.tsx +++ b/app/[locale]/about/overview/edit/page.tsx @@ -1,9 +1,9 @@ import { putOverviewAction } from '@/actions/about'; import { getOverview } from '@/apis/v1/about/overview'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { overview } from '@/constants/segmentNode'; import { getEditorFile, getEditorImage } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { overview } from '@/constants/segmentNode'; import AboutEditor, { AboutFormData } from '../../components/AboutEditor'; diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx index 2b2f5c308..89de481c0 100644 --- a/app/[locale]/about/page.tsx +++ b/app/[locale]/about/page.tsx @@ -1,6 +1,6 @@ import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { about } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export const dynamic = 'force-dynamic'; diff --git a/app/[locale]/about/student-clubs/ClubDetails.tsx b/app/[locale]/about/student-clubs/ClubDetails.tsx index 2f9800d20..4313557a0 100644 --- a/app/[locale]/about/student-clubs/ClubDetails.tsx +++ b/app/[locale]/about/student-clubs/ClubDetails.tsx @@ -1,15 +1,15 @@ 'use client'; import { deleteClubAction } from '@/actions/about'; +import { Club } from '@/apis/types/about'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionTitle from '@/components/common/selection/SelectionTitle'; import HTMLViewer from '@/components/form/html/HTMLViewer'; -import { Club } from '@/types/about'; +import { studentClubs } from '@/constants/segmentNode'; import { Language, WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { studentClubs } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { replaceSpaceWithDash } from '@/utils/string'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/about/student-clubs/components/ClubEditor.tsx b/app/[locale]/about/student-clubs/components/ClubEditor.tsx index 273f1393b..c0712c17a 100644 --- a/app/[locale]/about/student-clubs/components/ClubEditor.tsx +++ b/app/[locale]/about/student-clubs/components/ClubEditor.tsx @@ -1,16 +1,16 @@ 'use client'; +import { useState } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; + import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; +import { studentClubs } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { EditorImage } from '@/types/form'; import { Language, WithLanguage } from '@/types/language'; import { getPath } from '@/utils/page'; -import { studentClubs } from '@/constants/segmentNode'; -import { useState } from 'react'; -import { FormProvider, useForm } from 'react-hook-form'; const clubPath = getPath(studentClubs); diff --git a/app/[locale]/about/student-clubs/create/page.tsx b/app/[locale]/about/student-clubs/create/page.tsx index 62b44d282..5fcbaf2dd 100644 --- a/app/[locale]/about/student-clubs/create/page.tsx +++ b/app/[locale]/about/student-clubs/create/page.tsx @@ -6,6 +6,7 @@ import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; + import ClubEditor, { ClubFormData } from '../components/ClubEditor'; export default function StudentClubCreatePage() { diff --git a/app/[locale]/about/student-clubs/edit/StudentClubEditPageContent.tsx b/app/[locale]/about/student-clubs/edit/StudentClubEditPageContent.tsx index 75cca5025..5450dadab 100644 --- a/app/[locale]/about/student-clubs/edit/StudentClubEditPageContent.tsx +++ b/app/[locale]/about/student-clubs/edit/StudentClubEditPageContent.tsx @@ -1,13 +1,14 @@ 'use client'; import { putClubAction } from '@/actions/about'; +import { Club } from '@/apis/types/about'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { Club } from '@/types/about'; import { WithLanguage } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; + import ClubEditor, { ClubFormData } from '../components/ClubEditor'; export default function StudentClubEditPageContent({ data }: { data: WithLanguage }) { diff --git a/app/[locale]/about/student-clubs/page.tsx b/app/[locale]/about/student-clubs/page.tsx index cc18bb644..fa81e4f39 100644 --- a/app/[locale]/about/student-clubs/page.tsx +++ b/app/[locale]/about/student-clubs/page.tsx @@ -7,12 +7,12 @@ import { OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionList from '@/components/common/selection/SelectionList'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { studentClubs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { Language } from '@/types/language'; import { findItemBySearchParam } from '@/utils/findSelectedItem'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { studentClubs } from '@/constants/segmentNode'; import ClubDetails from './ClubDetails'; diff --git a/app/[locale]/academics/components/RoadMapButton.tsx b/app/[locale]/academics/components/RoadMapButton.tsx deleted file mode 100644 index a9638d97d..000000000 --- a/app/[locale]/academics/components/RoadMapButton.tsx +++ /dev/null @@ -1,29 +0,0 @@ -'use client'; - -import { useTranslations } from 'next-intl'; - -import Pentagon200 from '@/public/image/pentagon_200.svg'; -import SignPostIcon from '@/public/image/signpost_icon.svg'; -import useModal from '@/utils/hooks/useModal'; - -import RoadMapModal from './RoadMapModal'; - -export default function RoadMapButton() { - const { openModal, closeModal } = useModal(); - const t = useTranslations('Content'); - - return ( - - ); -} diff --git a/app/[locale]/academics/components/RoadMapModal.tsx b/app/[locale]/academics/components/RoadMapModal.tsx deleted file mode 100644 index a35a2fc35..000000000 --- a/app/[locale]/academics/components/RoadMapModal.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import Image from 'next/image'; -import { useTranslations } from 'next-intl'; - -import ModalFrame from '@/components/modal/ModalFrame'; -import roadmap from '@/public/image/roadmap.png'; -import SignPostIcon from '@/public/image/signpost_icon.svg'; - -export default function RoadMapModal({ onClose }: { onClose: () => void }) { - return ( - -
- - - - -
-
- ); -} - -function RoadMapTitle() { - const t = useTranslations('Content'); - - return ( -

- - - {t('교과목 로드맵')} - ({t('선수 교과목')}) - -

- ); -} - -function RoadMapDescription() { - return ( -

- 선수 교과목 그래프는 컴퓨터공학부 학부과정에서 어떤 전공과목을 수강하기에 앞서 자신이 과연 - 수강하려 하는 전공과목에 대해 얼마나 많은 배경지식을 가지고 있는지를 확인해 볼 수 있게 해 주는 - 그래프입니다. 어떤 과목을 수강하기 위해서는 그 과목으로 들어오는 화살표가 있는 과목들을 모두 - 들어두는 것이 유리합니다. -

- ); -} - -function RoadMap() { - return ( -
- 교과목_로드맵 -
- ); -} - -function CloseButton({ onClick }: { onClick: () => void }) { - return ( - - ); -} diff --git a/app/[locale]/academics/components/courses/AddCourseButton.tsx b/app/[locale]/academics/components/courses/AddCourseButton.tsx index 0b37a9efb..15a274418 100644 --- a/app/[locale]/academics/components/courses/AddCourseButton.tsx +++ b/app/[locale]/academics/components/courses/AddCourseButton.tsx @@ -1,4 +1,4 @@ -import { StudentType } from '@/types/academics'; +import { StudentType } from '@/apis/types/academics'; import useModal from '@/utils/hooks/useModal'; import AddCourseModal from './AddCourseModal'; diff --git a/app/[locale]/academics/components/courses/AddCourseModal.tsx b/app/[locale]/academics/components/courses/AddCourseModal.tsx index 6144bbeb8..1db244103 100644 --- a/app/[locale]/academics/components/courses/AddCourseModal.tsx +++ b/app/[locale]/academics/components/courses/AddCourseModal.tsx @@ -1,12 +1,12 @@ import { FormProvider, useForm } from 'react-hook-form'; import { postCourseAction } from '@/actions/academics'; +import { CLASSIFICATION, Course, GRADE, StudentType } from '@/apis/types/academics'; import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; import ModalFrame from '@/components/modal/ModalFrame'; -import { CLASSIFICATION, Course, GRADE, StudentType } from '@/types/academics'; -import { getKeys } from '@/utils/object'; import { errorToStr } from '@/utils/error'; +import { getKeys } from '@/utils/object'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/academics/components/courses/CourseCard.tsx b/app/[locale]/academics/components/courses/CourseCard.tsx index f5cc9dbc0..c8c34ffb4 100644 --- a/app/[locale]/academics/components/courses/CourseCard.tsx +++ b/app/[locale]/academics/components/courses/CourseCard.tsx @@ -1,7 +1,7 @@ import { useTranslations } from 'next-intl'; import { CSSProperties, useEffect, useReducer, useRef } from 'react'; -import { Course, GRADE, SortOption } from '@/types/academics'; +import { Course, GRADE, SortOption } from '@/apis/types/academics'; import { useTypedLocale } from '@/utils/hooks/useTypedLocale'; interface CourseCardProps { diff --git a/app/[locale]/academics/components/courses/CourseCards.tsx b/app/[locale]/academics/components/courses/CourseCards.tsx index ec7f7b948..f41e13c71 100644 --- a/app/[locale]/academics/components/courses/CourseCards.tsx +++ b/app/[locale]/academics/components/courses/CourseCards.tsx @@ -1,4 +1,4 @@ -import { Course, SortOption } from '@/types/academics'; +import { Course, SortOption } from '@/apis/types/academics'; import CourseRow from './CourseRow'; diff --git a/app/[locale]/academics/components/courses/CourseDetailModal.tsx b/app/[locale]/academics/components/courses/CourseDetailModal.tsx index b93f4edcd..a71ea8a77 100644 --- a/app/[locale]/academics/components/courses/CourseDetailModal.tsx +++ b/app/[locale]/academics/components/courses/CourseDetailModal.tsx @@ -2,11 +2,11 @@ import { useTranslations } from 'next-intl'; import { useReducer, useState } from 'react'; import { deleteCourseAction } from '@/actions/academics'; +import { Course, GRADE } from '@/apis/types/academics'; import { DeleteButton, GrayButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import ModalFrame from '@/components/modal/ModalFrame'; import BookmarkIcon from '@/public/image/bookmark_icon.svg'; -import { Course, GRADE } from '@/types/academics'; import { Language } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { useTypedLocale } from '@/utils/hooks/useTypedLocale'; diff --git a/app/[locale]/academics/components/courses/CourseEditor.tsx b/app/[locale]/academics/components/courses/CourseEditor.tsx index 77787d2d2..f1abee2ce 100644 --- a/app/[locale]/academics/components/courses/CourseEditor.tsx +++ b/app/[locale]/academics/components/courses/CourseEditor.tsx @@ -2,9 +2,9 @@ import { ReactNode } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { putCourseAction } from '@/actions/academics'; +import { CLASSIFICATION, ClassificationEn, Course, GRADE } from '@/apis/types/academics'; import Form from '@/components/form/Form'; import BookmarkIcon from '@/public/image/bookmark_icon.svg'; -import { CLASSIFICATION, ClassificationEn, Course, GRADE } from '@/types/academics'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/academics/components/courses/CourseList.tsx b/app/[locale]/academics/components/courses/CourseList.tsx index 04f868486..4487dbda3 100644 --- a/app/[locale]/academics/components/courses/CourseList.tsx +++ b/app/[locale]/academics/components/courses/CourseList.tsx @@ -1,4 +1,4 @@ -import { Course } from '@/types/academics'; +import { Course } from '@/apis/types/academics'; import CourseListHeader from './CourseListHeader'; import CourseListRow from './CourseListRow'; diff --git a/app/[locale]/academics/components/courses/CourseListRow.tsx b/app/[locale]/academics/components/courses/CourseListRow.tsx index f49138a6c..c6e71dc99 100644 --- a/app/[locale]/academics/components/courses/CourseListRow.tsx +++ b/app/[locale]/academics/components/courses/CourseListRow.tsx @@ -2,7 +2,7 @@ import { useTranslations } from 'next-intl'; -import { Course, GRADE } from '@/types/academics'; +import { Course, GRADE } from '@/apis/types/academics'; import useModal from '@/utils/hooks/useModal'; import { useTypedLocale } from '@/utils/hooks/useTypedLocale'; diff --git a/app/[locale]/academics/components/courses/CourseRow.tsx b/app/[locale]/academics/components/courses/CourseRow.tsx index dd951112e..8151c4778 100644 --- a/app/[locale]/academics/components/courses/CourseRow.tsx +++ b/app/[locale]/academics/components/courses/CourseRow.tsx @@ -2,7 +2,7 @@ import { useRef } from 'react'; -import { Course, SortOption } from '@/types/academics'; +import { Course, SortOption } from '@/apis/types/academics'; import CourseCard from './CourseCard'; diff --git a/app/[locale]/academics/components/courses/CourseToolbar.tsx b/app/[locale]/academics/components/courses/CourseToolbar.tsx index 58d8f7df1..b27a851e8 100644 --- a/app/[locale]/academics/components/courses/CourseToolbar.tsx +++ b/app/[locale]/academics/components/courses/CourseToolbar.tsx @@ -1,7 +1,7 @@ import { useTranslations } from 'next-intl'; +import { SortOption, ViewOption } from '@/apis/types/academics'; import { Tag } from '@/components/common/Tags'; -import { SortOption, ViewOption } from '@/types/academics'; interface CourseToolbarProps { viewOption: ViewOption; diff --git a/app/[locale]/academics/components/courses/useCourseToolbar.tsx b/app/[locale]/academics/components/courses/useCourseToolbar.tsx index 152fa2069..a5f1afa73 100644 --- a/app/[locale]/academics/components/courses/useCourseToolbar.tsx +++ b/app/[locale]/academics/components/courses/useCourseToolbar.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; -import { SortOption, ViewOption } from '@/types/academics'; +import { SortOption, ViewOption } from '@/apis/types/academics'; export default function useCourseToolbar() { const [selectedOption, setSelectedOption] = useState<{ view: ViewOption; sort: SortOption }>({ diff --git a/app/[locale]/academics/components/guide/GuideEditor.tsx b/app/[locale]/academics/components/guide/GuideEditor.tsx index 70f3faa15..905e4ee8f 100644 --- a/app/[locale]/academics/components/guide/GuideEditor.tsx +++ b/app/[locale]/academics/components/guide/GuideEditor.tsx @@ -3,10 +3,9 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { EditorFile } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; import { useRouter } from '@/i18n/routing'; +import { EditorFile } from '@/types/form'; export interface GuideFormData { description: string; diff --git a/app/[locale]/academics/components/guide/GuideEditorBridge.tsx b/app/[locale]/academics/components/guide/GuideEditorBridge.tsx index 47275ec61..6318610af 100644 --- a/app/[locale]/academics/components/guide/GuideEditorBridge.tsx +++ b/app/[locale]/academics/components/guide/GuideEditorBridge.tsx @@ -1,7 +1,7 @@ 'use client'; +import { Guide } from '@/apis/types/academics'; import GuideEditor, { GuideFormData } from '@/app/[locale]/academics/components/guide/GuideEditor'; -import { Guide } from '@/types/academics'; import { errorToStr } from '@/utils/error'; import { contentToFormData, getAttachmentDeleteIds } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/academics/components/guide/GuidePageContent.tsx b/app/[locale]/academics/components/guide/GuidePageContent.tsx index 30d301b8d..994c11d4d 100644 --- a/app/[locale]/academics/components/guide/GuidePageContent.tsx +++ b/app/[locale]/academics/components/guide/GuidePageContent.tsx @@ -1,12 +1,12 @@ 'use client'; +import { Guide } from '@/apis/types/academics'; import Attachments from '@/components/common/Attachments'; import { BlackButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { Link } from '@/i18n/routing'; -import { Guide } from '@/types/academics'; export default function GuidePageContent({ data, pathname }: { data: Guide; pathname: string }) { return ( diff --git a/app/[locale]/academics/components/scholarship/ScholarshipDetail.tsx b/app/[locale]/academics/components/scholarship/ScholarshipDetail.tsx index 8d2362136..a5151e9c4 100644 --- a/app/[locale]/academics/components/scholarship/ScholarshipDetail.tsx +++ b/app/[locale]/academics/components/scholarship/ScholarshipDetail.tsx @@ -1,14 +1,14 @@ 'use client'; import { deleteScholarshipAction } from '@/actions/academics'; +import { Scholarship, StudentType } from '@/apis/types/academics'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { Scholarship, StudentType } from '@/types/academics'; +import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/academics/components/scholarship/ScholarshipEditor.tsx b/app/[locale]/academics/components/scholarship/ScholarshipEditor.tsx index 231ce9d4b..a36dd1ad6 100644 --- a/app/[locale]/academics/components/scholarship/ScholarshipEditor.tsx +++ b/app/[locale]/academics/components/scholarship/ScholarshipEditor.tsx @@ -4,9 +4,8 @@ import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LanguagePicker from '@/components/form/LanguagePicker'; import { useRouter } from '@/i18n/routing'; import { Language } from '@/types/language'; import { errorToStr } from '@/utils/error'; diff --git a/app/[locale]/academics/components/scholarship/ScholarshipGuideEditor.tsx b/app/[locale]/academics/components/scholarship/ScholarshipGuideEditor.tsx index b50cafd02..7bcb88177 100644 --- a/app/[locale]/academics/components/scholarship/ScholarshipGuideEditor.tsx +++ b/app/[locale]/academics/components/scholarship/ScholarshipGuideEditor.tsx @@ -4,7 +4,6 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; import { useRouter } from '@/i18n/routing'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/academics/components/scholarship/ScholarshipPreview.tsx b/app/[locale]/academics/components/scholarship/ScholarshipPreview.tsx index 52e3c6c61..ef7b1ade3 100644 --- a/app/[locale]/academics/components/scholarship/ScholarshipPreview.tsx +++ b/app/[locale]/academics/components/scholarship/ScholarshipPreview.tsx @@ -1,13 +1,13 @@ 'use client'; +import { StudentType } from '@/apis/types/academics'; import { BlackButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; -import { StudentType } from '@/types/academics'; import { getPath } from '@/utils/page'; -import { graduateScholarship, undergraduateScholarship } from '@/constants/segmentNode'; const undergraduateScholarshipPath = getPath(undergraduateScholarship); const graduateScholarshipPath = getPath(graduateScholarship); @@ -66,7 +66,7 @@ function CreateButton({ type }: { type: StudentType }) { ); } -export interface ScholarshipRowProps { +interface ScholarshipRowProps { id: number; name: string; type: StudentType; diff --git a/app/[locale]/academics/components/timeline/TimelineEditor.tsx b/app/[locale]/academics/components/timeline/TimelineEditor.tsx index 20db74292..e8d63b63c 100644 --- a/app/[locale]/academics/components/timeline/TimelineEditor.tsx +++ b/app/[locale]/academics/components/timeline/TimelineEditor.tsx @@ -4,9 +4,8 @@ import { useRouter } from 'next/router'; import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { isUploadedFile, EditorFile } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import { EditorFile, isUploadedFile } from '@/types/form'; import { errorToStr } from '@/utils/error'; import { contentToFormData, getAttachmentDeleteIds } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/academics/graduate/course-changes/create/page.tsx b/app/[locale]/academics/graduate/course-changes/create/page.tsx index b44b58045..ca77053b5 100644 --- a/app/[locale]/academics/graduate/course-changes/create/page.tsx +++ b/app/[locale]/academics/graduate/course-changes/create/page.tsx @@ -1,9 +1,9 @@ import { postAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[postType]'; import TimelineEditor from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { undergraduateCourseChanges } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateCourseChanges } from '@/constants/segmentNode'; const courseChangesPath = getPath(undergraduateCourseChanges); diff --git a/app/[locale]/academics/graduate/course-changes/edit/page.tsx b/app/[locale]/academics/graduate/course-changes/edit/page.tsx index 3875424cc..84ddc3c3e 100644 --- a/app/[locale]/academics/graduate/course-changes/edit/page.tsx +++ b/app/[locale]/academics/graduate/course-changes/edit/page.tsx @@ -7,9 +7,9 @@ import TimelineEditor, { } from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_COURSE_CHANGES } from '@/constants/network'; +import { graduateCourseChanges } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { graduateCourseChanges } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const courseChangePath = getPath(graduateCourseChanges); diff --git a/app/[locale]/academics/graduate/course-changes/page.tsx b/app/[locale]/academics/graduate/course-changes/page.tsx index 88c6f04c8..48cf06aa6 100644 --- a/app/[locale]/academics/graduate/course-changes/page.tsx +++ b/app/[locale]/academics/graduate/course-changes/page.tsx @@ -5,8 +5,8 @@ import { deleteCourseChanges } from '@/apis/v1/academics/[studentType]/course-ch import TimelineViewer from '@/app/[locale]/academics/components/timeline/TimelineViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_COURSE_CHANGES } from '@/constants/network'; -import { getMetadata } from '@/utils/metadata'; import { undergraduateCourseChanges } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/academics/graduate/courses/GraduateCoursePageContent.tsx b/app/[locale]/academics/graduate/courses/GraduateCoursePageContent.tsx index 6810ae4c6..b7da062c6 100644 --- a/app/[locale]/academics/graduate/courses/GraduateCoursePageContent.tsx +++ b/app/[locale]/academics/graduate/courses/GraduateCoursePageContent.tsx @@ -2,8 +2,8 @@ import { useTranslations } from 'next-intl'; +import { Course } from '@/apis/types/academics'; import LoginVisible from '@/components/common/LoginVisible'; -import { Course } from '@/types/academics'; import { Language } from '@/types/language'; import useResponsive from '@/utils/hooks/useResponsive'; diff --git a/app/[locale]/academics/graduate/courses/page.tsx b/app/[locale]/academics/graduate/courses/page.tsx index 69a55c86d..b8d389a00 100644 --- a/app/[locale]/academics/graduate/courses/page.tsx +++ b/app/[locale]/academics/graduate/courses/page.tsx @@ -1,8 +1,8 @@ import { getCourses } from '@/apis/v2/academics/courses'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { graduateCourses } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; -import { graduateCourses } from '@/constants/segmentNode'; import GraduateCoursePageContent from './GraduateCoursePageContent'; diff --git a/app/[locale]/academics/graduate/guide/edit/page.tsx b/app/[locale]/academics/graduate/guide/edit/page.tsx index a68f779ae..1fe6a72c8 100644 --- a/app/[locale]/academics/graduate/guide/edit/page.tsx +++ b/app/[locale]/academics/graduate/guide/edit/page.tsx @@ -4,9 +4,9 @@ import { getAcademicsGuide, putAcademicsGuide } from '@/apis/v1/academics/[stude import GuideEditBridge from '@/app/[locale]/academics/components/guide/GuideEditorBridge'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_GUIDE } from '@/constants/network'; +import { graduateGuide } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { graduateGuide } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const path = getPath(graduateGuide); diff --git a/app/[locale]/academics/graduate/guide/page.tsx b/app/[locale]/academics/graduate/guide/page.tsx index d107ceb0b..1b01a6e5b 100644 --- a/app/[locale]/academics/graduate/guide/page.tsx +++ b/app/[locale]/academics/graduate/guide/page.tsx @@ -1,7 +1,7 @@ import { getAcademicsGuide } from '@/apis/v1/academics/[studentType]/guide'; +import { graduateGuide } from '@/constants/segmentNode'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { graduateGuide } from '@/constants/segmentNode'; import GuidePageContent from '../../components/guide/GuidePageContent'; diff --git a/app/[locale]/academics/graduate/scholarship/[id]/edit/page.tsx b/app/[locale]/academics/graduate/scholarship/[id]/edit/page.tsx index 2f5b0d7dc..606ba7a61 100644 --- a/app/[locale]/academics/graduate/scholarship/[id]/edit/page.tsx +++ b/app/[locale]/academics/graduate/scholarship/[id]/edit/page.tsx @@ -8,9 +8,9 @@ import ScholarshipEditor, { import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { graduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { graduateScholarship } from '@/constants/segmentNode'; const path = getPath(graduateScholarship); diff --git a/app/[locale]/academics/graduate/scholarship/[id]/page.tsx b/app/[locale]/academics/graduate/scholarship/[id]/page.tsx index e1567b5ec..473680c60 100644 --- a/app/[locale]/academics/graduate/scholarship/[id]/page.tsx +++ b/app/[locale]/academics/graduate/scholarship/[id]/page.tsx @@ -1,8 +1,8 @@ import { getScholarship } from '@/apis/v2/academics/scholarship/[id]'; import InvalidIDFallback from '@/components/common/InvalidIDFallback'; +import { graduateScholarship } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; -import { graduateScholarship } from '@/constants/segmentNode'; import ScholarshipDetail from '../../../components/scholarship/ScholarshipDetail'; diff --git a/app/[locale]/academics/graduate/scholarship/create/page.tsx b/app/[locale]/academics/graduate/scholarship/create/page.tsx index d925cd211..837e13c2b 100644 --- a/app/[locale]/academics/graduate/scholarship/create/page.tsx +++ b/app/[locale]/academics/graduate/scholarship/create/page.tsx @@ -6,9 +6,9 @@ import ScholarshipEditor, { } from '@/app/[locale]/academics/components/scholarship/ScholarshipEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { graduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { graduateScholarship } from '@/constants/segmentNode'; const path = getPath(graduateScholarship); diff --git a/app/[locale]/academics/graduate/scholarship/edit/page.tsx b/app/[locale]/academics/graduate/scholarship/edit/page.tsx index 0b6c05e9b..5cbe36d28 100644 --- a/app/[locale]/academics/graduate/scholarship/edit/page.tsx +++ b/app/[locale]/academics/graduate/scholarship/edit/page.tsx @@ -4,9 +4,9 @@ import { getScholarshipList } from '@/apis/v1/academics/scholarship'; import { putScholarshipGuide } from '@/apis/v2/academics/[type]/scholarship'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { graduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { graduateScholarship } from '@/constants/segmentNode'; import { successToast } from '@/utils/toast'; import ScholarshipGuideEditor, { diff --git a/app/[locale]/academics/graduate/scholarship/page.tsx b/app/[locale]/academics/graduate/scholarship/page.tsx index e329526b4..b14935620 100644 --- a/app/[locale]/academics/graduate/scholarship/page.tsx +++ b/app/[locale]/academics/graduate/scholarship/page.tsx @@ -1,6 +1,6 @@ import { getScholarshipList } from '@/apis/v1/academics/scholarship'; -import { getMetadata } from '@/utils/metadata'; import { graduateScholarship } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import ScholarshipPreview from '../../components/scholarship/ScholarshipPreview'; diff --git a/app/[locale]/academics/page.tsx b/app/[locale]/academics/page.tsx index d8826ed0b..6b7d53490 100644 --- a/app/[locale]/academics/page.tsx +++ b/app/[locale]/academics/page.tsx @@ -1,6 +1,6 @@ import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { academics } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/academics/undergraduate/course-changes/create/page.tsx b/app/[locale]/academics/undergraduate/course-changes/create/page.tsx index 9c4289891..5cebae92d 100644 --- a/app/[locale]/academics/undergraduate/course-changes/create/page.tsx +++ b/app/[locale]/academics/undergraduate/course-changes/create/page.tsx @@ -1,8 +1,8 @@ import { postAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[postType]'; import TimelineEditor from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getPath } from '@/utils/page'; import { undergraduateCourseChanges } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; const courseChangesPath = getPath(undergraduateCourseChanges); diff --git a/app/[locale]/academics/undergraduate/course-changes/edit/page.tsx b/app/[locale]/academics/undergraduate/course-changes/edit/page.tsx index 5f3e91e54..88b05f9a3 100644 --- a/app/[locale]/academics/undergraduate/course-changes/edit/page.tsx +++ b/app/[locale]/academics/undergraduate/course-changes/edit/page.tsx @@ -7,9 +7,9 @@ import TimelineEditor, { } from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_COURSE_CHANGES } from '@/constants/network'; +import { undergraduateCourseChanges } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateCourseChanges } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const courseChangePath = getPath(undergraduateCourseChanges); diff --git a/app/[locale]/academics/undergraduate/course-changes/page.tsx b/app/[locale]/academics/undergraduate/course-changes/page.tsx index 0480102bc..649d6061c 100644 --- a/app/[locale]/academics/undergraduate/course-changes/page.tsx +++ b/app/[locale]/academics/undergraduate/course-changes/page.tsx @@ -5,8 +5,8 @@ import { deleteCourseChanges } from '@/apis/v1/academics/[studentType]/course-ch import TimelineViewer from '@/app/[locale]/academics/components/timeline/TimelineViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_COURSE_CHANGES } from '@/constants/network'; -import { getMetadata } from '@/utils/metadata'; import { undergraduateCourseChanges } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/academics/undergraduate/courses/UndergraduateCoursePageContent.tsx b/app/[locale]/academics/undergraduate/courses/UndergraduateCoursePageContent.tsx index 40611aee4..1b202dcd3 100644 --- a/app/[locale]/academics/undergraduate/courses/UndergraduateCoursePageContent.tsx +++ b/app/[locale]/academics/undergraduate/courses/UndergraduateCoursePageContent.tsx @@ -2,8 +2,8 @@ import { useTranslations } from 'next-intl'; +import { Classification, Course, SortOption } from '@/apis/types/academics'; import LoginVisible from '@/components/common/LoginVisible'; -import { Classification, Course, SortOption } from '@/types/academics'; import { Language } from '@/types/language'; import useResponsive from '@/utils/hooks/useResponsive'; diff --git a/app/[locale]/academics/undergraduate/courses/page.tsx b/app/[locale]/academics/undergraduate/courses/page.tsx index 135fed552..3cb33ea8f 100644 --- a/app/[locale]/academics/undergraduate/courses/page.tsx +++ b/app/[locale]/academics/undergraduate/courses/page.tsx @@ -1,9 +1,9 @@ +import { Course } from '@/apis/types/academics'; import { getCourses } from '@/apis/v2/academics/courses'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { Course } from '@/types/academics'; +import { undergraduateCourses } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; -import { undergraduateCourses } from '@/constants/segmentNode'; import UndergraduateCoursePageContent from './UndergraduateCoursePageContent'; diff --git a/app/[locale]/academics/undergraduate/curriculum/CurriculumPageContent.tsx b/app/[locale]/academics/undergraduate/curriculum/CurriculumPageContent.tsx index c50e5563a..1f266da0b 100644 --- a/app/[locale]/academics/undergraduate/curriculum/CurriculumPageContent.tsx +++ b/app/[locale]/academics/undergraduate/curriculum/CurriculumPageContent.tsx @@ -1,8 +1,8 @@ 'use client'; import { deleteCurriculumAction } from '@/actions/academics'; +import { Curriculum } from '@/apis/types/academics'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { Curriculum } from '@/types/academics'; import TimelineViewer from '../../components/timeline/TimelineViewer'; diff --git a/app/[locale]/academics/undergraduate/curriculum/create/page.tsx b/app/[locale]/academics/undergraduate/curriculum/create/page.tsx index 2bd54a626..f38caeecc 100644 --- a/app/[locale]/academics/undergraduate/curriculum/create/page.tsx +++ b/app/[locale]/academics/undergraduate/curriculum/create/page.tsx @@ -4,8 +4,8 @@ import { postAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[post import TimelineEditor from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_CURRICULUM } from '@/constants/network'; -import { getPath } from '@/utils/page'; import { curriculum } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { decodeFormDataFileName } from '@/utils/string'; const curriculumPath = getPath(curriculum); diff --git a/app/[locale]/academics/undergraduate/curriculum/edit/CurriculumEditPageContent.tsx b/app/[locale]/academics/undergraduate/curriculum/edit/CurriculumEditPageContent.tsx index f3c2604f3..30d8243a8 100644 --- a/app/[locale]/academics/undergraduate/curriculum/edit/CurriculumEditPageContent.tsx +++ b/app/[locale]/academics/undergraduate/curriculum/edit/CurriculumEditPageContent.tsx @@ -1,14 +1,14 @@ import { revalidateTag } from 'next/cache'; +import { Curriculum } from '@/apis/types/academics'; import { putAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[postType]'; import TimelineEditor, { TimelineFormData, } from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_CURRICULUM } from '@/constants/network'; -import { Curriculum } from '@/types/academics'; -import { getPath } from '@/utils/page'; import { curriculum } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; const curriculumPath = getPath(curriculum); diff --git a/app/[locale]/academics/undergraduate/curriculum/page.tsx b/app/[locale]/academics/undergraduate/curriculum/page.tsx index da38769b1..1dec8931f 100644 --- a/app/[locale]/academics/undergraduate/curriculum/page.tsx +++ b/app/[locale]/academics/undergraduate/curriculum/page.tsx @@ -1,8 +1,8 @@ import './style.css'; import { getCurriculum } from '@/apis/v1/academics/undergraduate/curriculum'; -import { getMetadata } from '@/utils/metadata'; import { curriculum } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import CurriculumPageContent from './CurriculumPageContent'; diff --git a/app/[locale]/academics/undergraduate/degree-requirements/edit/DegreeRequirementsEditor.tsx b/app/[locale]/academics/undergraduate/degree-requirements/edit/DegreeRequirementsEditor.tsx index 7a6a9d1ec..ea4cf7297 100644 --- a/app/[locale]/academics/undergraduate/degree-requirements/edit/DegreeRequirementsEditor.tsx +++ b/app/[locale]/academics/undergraduate/degree-requirements/edit/DegreeRequirementsEditor.tsx @@ -3,21 +3,20 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { isUploadedFile, EditorFile } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { degree } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { EditorFile, isUploadedFile } from '@/types/form'; import { errorToStr } from '@/utils/error'; import { contentToFormData, getAttachmentDeleteIds } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { degree } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast } from '@/utils/toast'; const degreeRequirementsPath = getPath(degree); -export type DegreeRequirementsFormData = { +type DegreeRequirementsFormData = { description: string; files: EditorFile[]; }; diff --git a/app/[locale]/academics/undergraduate/degree-requirements/edit/page.tsx b/app/[locale]/academics/undergraduate/degree-requirements/edit/page.tsx index 5bc5b8536..1c32499f8 100644 --- a/app/[locale]/academics/undergraduate/degree-requirements/edit/page.tsx +++ b/app/[locale]/academics/undergraduate/degree-requirements/edit/page.tsx @@ -5,9 +5,9 @@ import { putDegreeRequirements, } from '@/apis/v1/academics/undergraduate/degree-requirements'; import { FETCH_TAG_DEGREE } from '@/constants/network'; +import { degree } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { degree } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; import DegreeRequirementsEditor from './DegreeRequirementsEditor'; diff --git a/app/[locale]/academics/undergraduate/degree-requirements/page.tsx b/app/[locale]/academics/undergraduate/degree-requirements/page.tsx index f14d2b02d..23b318dc0 100644 --- a/app/[locale]/academics/undergraduate/degree-requirements/page.tsx +++ b/app/[locale]/academics/undergraduate/degree-requirements/page.tsx @@ -5,10 +5,10 @@ import LoginVisible from '@/components/common/LoginVisible'; import { StraightNode } from '@/components/common/Nodes'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { degree } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { degree } from '@/constants/segmentNode'; const degreeRequirementsPath = getPath(degree); diff --git a/app/[locale]/academics/undergraduate/general-studies-requirements/GeneralStudiesPageContent.tsx b/app/[locale]/academics/undergraduate/general-studies-requirements/GeneralStudiesPageContent.tsx index 8497dac34..bafde93aa 100644 --- a/app/[locale]/academics/undergraduate/general-studies-requirements/GeneralStudiesPageContent.tsx +++ b/app/[locale]/academics/undergraduate/general-studies-requirements/GeneralStudiesPageContent.tsx @@ -1,8 +1,8 @@ 'use client'; import { deleteGeneralStudiesAction } from '@/actions/academics'; +import { GeneralStudiesRequirement } from '@/apis/types/academics'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { GeneralStudiesRequirement } from '@/types/academics'; import TimelineViewer from '../../components/timeline/TimelineViewer'; diff --git a/app/[locale]/academics/undergraduate/general-studies-requirements/create/page.tsx b/app/[locale]/academics/undergraduate/general-studies-requirements/create/page.tsx index 83a992ad9..f5ba13211 100644 --- a/app/[locale]/academics/undergraduate/general-studies-requirements/create/page.tsx +++ b/app/[locale]/academics/undergraduate/general-studies-requirements/create/page.tsx @@ -1,8 +1,8 @@ import { postAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[postType]'; import TimelineEditor from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getPath } from '@/utils/page'; import { curriculum } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { decodeFormDataFileName } from '@/utils/string'; const curriculumPath = getPath(curriculum); diff --git a/app/[locale]/academics/undergraduate/general-studies-requirements/edit/GeneralStudiesEditPageContent.tsx b/app/[locale]/academics/undergraduate/general-studies-requirements/edit/GeneralStudiesEditPageContent.tsx index 3a6840b2d..e485eb60f 100644 --- a/app/[locale]/academics/undergraduate/general-studies-requirements/edit/GeneralStudiesEditPageContent.tsx +++ b/app/[locale]/academics/undergraduate/general-studies-requirements/edit/GeneralStudiesEditPageContent.tsx @@ -1,11 +1,11 @@ +import { GeneralStudiesRequirement } from '@/apis/types/academics'; import { putAcademicsByPostType } from '@/apis/v1/academics/[studentType]/[postType]'; import TimelineEditor, { TimelineFormData, } from '@/app/[locale]/academics/components/timeline/TimelineEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { GeneralStudiesRequirement } from '@/types/academics'; -import { getPath } from '@/utils/page'; import { curriculum } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; const curriculumPath = getPath(curriculum); diff --git a/app/[locale]/academics/undergraduate/general-studies-requirements/page.tsx b/app/[locale]/academics/undergraduate/general-studies-requirements/page.tsx index 31d902056..ef39946ab 100644 --- a/app/[locale]/academics/undergraduate/general-studies-requirements/page.tsx +++ b/app/[locale]/academics/undergraduate/general-studies-requirements/page.tsx @@ -1,6 +1,6 @@ import { getGeneralStudies } from '@/apis/v1/academics/undergraduate/general-studies-requirements'; -import { getMetadata } from '@/utils/metadata'; import { generalStudies } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import GeneralStudiesPageContent from './GeneralStudiesPageContent'; diff --git a/app/[locale]/academics/undergraduate/guide/edit/page.tsx b/app/[locale]/academics/undergraduate/guide/edit/page.tsx index 831e72f35..a11012a9c 100644 --- a/app/[locale]/academics/undergraduate/guide/edit/page.tsx +++ b/app/[locale]/academics/undergraduate/guide/edit/page.tsx @@ -4,9 +4,9 @@ import { getAcademicsGuide, putAcademicsGuide } from '@/apis/v1/academics/[stude import GuideEditBridge from '@/app/[locale]/academics/components/guide/GuideEditorBridge'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_GUIDE } from '@/constants/network'; +import { undergraduateGuide } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateGuide } from '@/constants/segmentNode'; import { decodeFormDataFileName } from '@/utils/string'; const path = getPath(undergraduateGuide); diff --git a/app/[locale]/academics/undergraduate/guide/page.tsx b/app/[locale]/academics/undergraduate/guide/page.tsx index 37aa250e3..f9f8f486a 100644 --- a/app/[locale]/academics/undergraduate/guide/page.tsx +++ b/app/[locale]/academics/undergraduate/guide/page.tsx @@ -1,7 +1,7 @@ import { getAcademicsGuide } from '@/apis/v1/academics/[studentType]/guide'; +import { undergraduateGuide } from '@/constants/segmentNode'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { undergraduateGuide } from '@/constants/segmentNode'; import GuidePageContent from '../../components/guide/GuidePageContent'; diff --git a/app/[locale]/academics/undergraduate/scholarship/[id]/edit/page.tsx b/app/[locale]/academics/undergraduate/scholarship/[id]/edit/page.tsx index 5cf314fb5..25dd34545 100644 --- a/app/[locale]/academics/undergraduate/scholarship/[id]/edit/page.tsx +++ b/app/[locale]/academics/undergraduate/scholarship/[id]/edit/page.tsx @@ -8,9 +8,9 @@ import ScholarshipEditor, { import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { undergraduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateScholarship } from '@/constants/segmentNode'; const path = getPath(undergraduateScholarship); diff --git a/app/[locale]/academics/undergraduate/scholarship/[id]/page.tsx b/app/[locale]/academics/undergraduate/scholarship/[id]/page.tsx index 6dd69939c..3fbbc4e78 100644 --- a/app/[locale]/academics/undergraduate/scholarship/[id]/page.tsx +++ b/app/[locale]/academics/undergraduate/scholarship/[id]/page.tsx @@ -1,8 +1,8 @@ import { getScholarship } from '@/apis/v2/academics/scholarship/[id]'; import InvalidIDFallback from '@/components/common/InvalidIDFallback'; +import { undergraduateScholarship } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; -import { undergraduateScholarship } from '@/constants/segmentNode'; import ScholarshipDetail from '../../../components/scholarship/ScholarshipDetail'; diff --git a/app/[locale]/academics/undergraduate/scholarship/create/page.tsx b/app/[locale]/academics/undergraduate/scholarship/create/page.tsx index 2d99aca7d..e4d38cdb8 100644 --- a/app/[locale]/academics/undergraduate/scholarship/create/page.tsx +++ b/app/[locale]/academics/undergraduate/scholarship/create/page.tsx @@ -6,9 +6,9 @@ import ScholarshipEditor, { } from '@/app/[locale]/academics/components/scholarship/ScholarshipEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { undergraduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateScholarship } from '@/constants/segmentNode'; const path = getPath(undergraduateScholarship); diff --git a/app/[locale]/academics/undergraduate/scholarship/edit/page.tsx b/app/[locale]/academics/undergraduate/scholarship/edit/page.tsx index 57342a035..b4785ad3c 100644 --- a/app/[locale]/academics/undergraduate/scholarship/edit/page.tsx +++ b/app/[locale]/academics/undergraduate/scholarship/edit/page.tsx @@ -4,9 +4,9 @@ import { getScholarshipList } from '@/apis/v1/academics/scholarship'; import { putScholarshipGuide } from '@/apis/v2/academics/[type]/scholarship'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { FETCH_TAG_SCHOLARSHIP } from '@/constants/network'; +import { undergraduateScholarship } from '@/constants/segmentNode'; import { redirectKo } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { undergraduateScholarship } from '@/constants/segmentNode'; import { successToast } from '@/utils/toast'; import ScholarshipGuideEditor, { diff --git a/app/[locale]/academics/undergraduate/scholarship/page.tsx b/app/[locale]/academics/undergraduate/scholarship/page.tsx index d70b8f32f..92449d189 100644 --- a/app/[locale]/academics/undergraduate/scholarship/page.tsx +++ b/app/[locale]/academics/undergraduate/scholarship/page.tsx @@ -1,6 +1,6 @@ import { getScholarshipList } from '@/apis/v1/academics/scholarship'; -import { getMetadata } from '@/utils/metadata'; import { undergraduateScholarship } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import ScholarshipPreview from '../../components/scholarship/ScholarshipPreview'; diff --git a/app/[locale]/admin/helper/important/ImportantList.tsx b/app/[locale]/admin/helper/important/ImportantList.tsx index 28b19003f..4eff9eeed 100644 --- a/app/[locale]/admin/helper/important/ImportantList.tsx +++ b/app/[locale]/admin/helper/important/ImportantList.tsx @@ -1,6 +1,6 @@ import { Dispatch } from 'react'; -import { ImportantPostIdentifier, ImportantPreview } from '@/types/admin'; +import { ImportantPostIdentifier, ImportantPreview } from '@/apis/types/admin'; import ImportantListHeader from './ImportantListHeader'; import ImportantListRow from './ImportantListRow'; diff --git a/app/[locale]/admin/helper/important/ImportantListRow.tsx b/app/[locale]/admin/helper/important/ImportantListRow.tsx index 5b7e17f35..1a8025b57 100644 --- a/app/[locale]/admin/helper/important/ImportantListRow.tsx +++ b/app/[locale]/admin/helper/important/ImportantListRow.tsx @@ -1,6 +1,6 @@ -import { ImportantPostIdentifier, ImportantPreview } from '@/types/admin'; -import { getPath } from '@/utils/page'; +import { ImportantPostIdentifier, ImportantPreview } from '@/apis/types/admin'; import { news, notice, seminar } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { CategoryCell, CheckboxCell, DateCell, EditCell, IndexCell, TitleCell } from '../ListCell'; diff --git a/app/[locale]/admin/helper/important/ImportantManagement.tsx b/app/[locale]/admin/helper/important/ImportantManagement.tsx index 1c4b6e410..6c605e330 100644 --- a/app/[locale]/admin/helper/important/ImportantManagement.tsx +++ b/app/[locale]/admin/helper/important/ImportantManagement.tsx @@ -1,9 +1,9 @@ 'use client'; import { batchUnimportantAction } from '@/actions/admin'; +import { ImportantPreview } from '@/apis/types/admin'; import Pagination from '@/components/common/Pagination'; import AlertModal from '@/components/modal/AlertModal'; -import { ImportantPreview } from '@/types/admin'; import useModal from '@/utils/hooks/useModal'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/admin/helper/important/useImportantSelect.ts b/app/[locale]/admin/helper/important/useImportantSelect.ts index 0fc9afb82..5cdeaa345 100644 --- a/app/[locale]/admin/helper/important/useImportantSelect.ts +++ b/app/[locale]/admin/helper/important/useImportantSelect.ts @@ -1,6 +1,6 @@ import { useReducer } from 'react'; -import { ImportantCategory, ImportantPostIdentifier } from '@/types/admin'; +import { ImportantCategory, ImportantPostIdentifier } from '@/apis/types/admin'; export default function useImportantSelect() { const value = useReducer(reducer, []); diff --git a/app/[locale]/admin/helper/slide/SlideList.tsx b/app/[locale]/admin/helper/slide/SlideList.tsx index 8366242aa..85fd8e49e 100644 --- a/app/[locale]/admin/helper/slide/SlideList.tsx +++ b/app/[locale]/admin/helper/slide/SlideList.tsx @@ -1,6 +1,6 @@ import { Dispatch } from 'react'; -import { SlidePreview } from '@/types/admin'; +import { SlidePreview } from '@/apis/types/admin'; import SlideListHeader from './SlideLIstHeader'; import SlideListRow from './SlideListRow'; diff --git a/app/[locale]/admin/helper/slide/SlideListRow.tsx b/app/[locale]/admin/helper/slide/SlideListRow.tsx index 31a3b7604..43cdbc554 100644 --- a/app/[locale]/admin/helper/slide/SlideListRow.tsx +++ b/app/[locale]/admin/helper/slide/SlideListRow.tsx @@ -1,6 +1,6 @@ -import { SlidePreview } from '@/types/admin'; -import { getPath } from '@/utils/page'; +import { SlidePreview } from '@/apis/types/admin'; import { news } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { CheckboxCell, DateCell, EditCell, IndexCell, TitleCell } from '../ListCell'; diff --git a/app/[locale]/admin/helper/slide/SlideManagement.tsx b/app/[locale]/admin/helper/slide/SlideManagement.tsx index 94578753b..64fc72480 100644 --- a/app/[locale]/admin/helper/slide/SlideManagement.tsx +++ b/app/[locale]/admin/helper/slide/SlideManagement.tsx @@ -1,9 +1,9 @@ 'use client'; import { batchUnslideAction } from '@/actions/admin'; +import { SlidePreview } from '@/apis/types/admin'; import Pagination from '@/components/common/Pagination'; import AlertModal from '@/components/modal/AlertModal'; -import { SlidePreview } from '@/types/admin'; import useModal from '@/utils/hooks/useModal'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/admin/page.tsx b/app/[locale]/admin/page.tsx index d3ccd96ea..669c45b2a 100644 --- a/app/[locale]/admin/page.tsx +++ b/app/[locale]/admin/page.tsx @@ -1,3 +1,4 @@ +import { ADMIN_MENU_IMPORTANT, ADMIN_MENU_SLIDE } from '@/apis/types/admin'; import { getImportants } from '@/apis/v1/admin/important'; import { getSlides } from '@/apis/v1/admin/slide'; import ImportantManagement from '@/app/[locale]/admin/helper/important/ImportantManagement'; @@ -5,9 +6,8 @@ import SlideManagement from '@/app/[locale]/admin/helper/slide/SlideManagement'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionList from '@/components/common/selection/SelectionList'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { ADMIN_MENU_IMPORTANT, ADMIN_MENU_SLIDE } from '@/types/admin'; -import { getPath } from '@/utils/page'; import { admin } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import { replaceDashWithSpace } from '@/utils/string'; interface AdminPageProps { diff --git a/app/[locale]/admissions/graduate/regular-admission/page.tsx b/app/[locale]/admissions/graduate/regular-admission/page.tsx index e45ae1bc4..2616602ad 100644 --- a/app/[locale]/admissions/graduate/regular-admission/page.tsx +++ b/app/[locale]/admissions/graduate/regular-admission/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getGraduateRegularAdmission } from '@/apis/v1/admissions/graduate/regular-admission'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { graduateAdmission } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/international/exchange/page.tsx b/app/[locale]/admissions/international/exchange/page.tsx index c01af2095..1c3ed7e4b 100644 --- a/app/[locale]/admissions/international/exchange/page.tsx +++ b/app/[locale]/admissions/international/exchange/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getInternationalExchangeVisiting } from '@/apis/v1/admissions/international/exchange-visiting'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { exchangeVisitingProgram } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/international/graduate/page.tsx b/app/[locale]/admissions/international/graduate/page.tsx index 921be7da9..417d4b3ee 100644 --- a/app/[locale]/admissions/international/graduate/page.tsx +++ b/app/[locale]/admissions/international/graduate/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getInternationalgraduate } from '@/apis/v1/admissions/international/graduate'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { internationalGraduateAdmission } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/international/scholarships/page.tsx b/app/[locale]/admissions/international/scholarships/page.tsx index e0a8593a1..2f80c26af 100644 --- a/app/[locale]/admissions/international/scholarships/page.tsx +++ b/app/[locale]/admissions/international/scholarships/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getInternationalScholarships } from '@/apis/v1/admissions/international/scholarships'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { internationalScholarships } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/international/undergraduate/page.tsx b/app/[locale]/admissions/international/undergraduate/page.tsx index 846d0be05..102575f63 100644 --- a/app/[locale]/admissions/international/undergraduate/page.tsx +++ b/app/[locale]/admissions/international/undergraduate/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getInternationalUndergraduate } from '@/apis/v1/admissions/international/undergraduate'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { internationalUndergraduateAdmission } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/page.tsx b/app/[locale]/admissions/page.tsx index 8c04f4cfa..dfbde040a 100644 --- a/app/[locale]/admissions/page.tsx +++ b/app/[locale]/admissions/page.tsx @@ -1,8 +1,8 @@ import { Metadata } from 'next'; import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { admissions } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/undergraduate/early-admission/page.tsx b/app/[locale]/admissions/undergraduate/early-admission/page.tsx index 26611cf66..cb9164d67 100644 --- a/app/[locale]/admissions/undergraduate/early-admission/page.tsx +++ b/app/[locale]/admissions/undergraduate/early-admission/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getUndergraduateEarlyAdmission } from '@/apis/v1/admissions/undergraduate/early-admission'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { undergraduateEarlyAdmission } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/admissions/undergraduate/regular-admission/page.tsx b/app/[locale]/admissions/undergraduate/regular-admission/page.tsx index bec417c40..23cf49b8f 100644 --- a/app/[locale]/admissions/undergraduate/regular-admission/page.tsx +++ b/app/[locale]/admissions/undergraduate/regular-admission/page.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getUndergraduateRegularAdmission } from '@/apis/v1/admissions/undergraduate/regular-admission'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { undergraduateRegularAdmission } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/community/components/PostFooter.tsx b/app/[locale]/community/components/PostFooter.tsx index af1741fc0..3a0b0f4cb 100644 --- a/app/[locale]/community/components/PostFooter.tsx +++ b/app/[locale]/community/components/PostFooter.tsx @@ -1,10 +1,10 @@ import { useTranslations } from 'next-intl'; +import { News } from '@/apis/types/news'; +import { Notice } from '@/apis/types/notice'; +import { Seminar } from '@/apis/types/seminar'; import LoginVisible from '@/components/common/LoginVisible'; import { Link } from '@/i18n/routing'; -import { News } from '@/types/news'; -import { Notice } from '@/types/notice'; -import { Seminar } from '@/types/seminar'; import PaginatedLink from './PaginatedLink'; import PostDeleteButton from './PostDeleteButton'; diff --git a/app/[locale]/community/faculty-recruitment/edit/FacultyRecruitmentEditPageContent.tsx b/app/[locale]/community/faculty-recruitment/edit/FacultyRecruitmentEditPageContent.tsx index 2302c0a45..aa6387152 100644 --- a/app/[locale]/community/faculty-recruitment/edit/FacultyRecruitmentEditPageContent.tsx +++ b/app/[locale]/community/faculty-recruitment/edit/FacultyRecruitmentEditPageContent.tsx @@ -3,16 +3,16 @@ import { FormProvider, useForm } from 'react-hook-form'; import { putFacultyRecruitmentAction } from '@/actions/recruitment'; +import { GETFacultyRecruitmentResponse } from '@/apis/types/post'; import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; -import { EditorImage } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { facultyRecruitment } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { GETFacultyRecruitmentResponse } from '@/types/post'; +import { EditorImage } from '@/types/form'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { facultyRecruitment } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/community/faculty-recruitment/page.tsx b/app/[locale]/community/faculty-recruitment/page.tsx index 26a34b1a1..2d4aa2123 100644 --- a/app/[locale]/community/faculty-recruitment/page.tsx +++ b/app/[locale]/community/faculty-recruitment/page.tsx @@ -3,10 +3,10 @@ import { EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { facultyRecruitment } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { facultyRecruitment } from '@/constants/segmentNode'; export async function generateMetadata(props: { params: Promise<{ locale: Language }> }) { const params = await props.params; diff --git a/app/[locale]/community/news/[id]/NewsViewer.tsx b/app/[locale]/community/news/[id]/NewsViewer.tsx index 26753665e..90eda0650 100644 --- a/app/[locale]/community/news/[id]/NewsViewer.tsx +++ b/app/[locale]/community/news/[id]/NewsViewer.tsx @@ -1,16 +1,16 @@ // TODO: searchParams를 사용했음에도 static rendering이 되는 것 같아 추가 export const dynamic = 'force-dynamic'; +import { News } from '@/apis/types/news'; import PostFooter from '@/app/[locale]/community/components/PostFooter'; import Attachments from '@/components/common/Attachments'; import { StraightNode } from '@/components/common/Nodes'; import Tags from '@/components/common/Tags'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; -import { News } from '@/types/news'; +import { news } from '@/constants/segmentNode'; import { formatNewsPostDateStr } from '@/utils/date'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; interface NewsPostPageProps { news: News; diff --git a/app/[locale]/community/news/[id]/edit/EditNewsPageContent.tsx b/app/[locale]/community/news/[id]/edit/EditNewsPageContent.tsx index 588ded847..4ea89b275 100644 --- a/app/[locale]/community/news/[id]/edit/EditNewsPageContent.tsx +++ b/app/[locale]/community/news/[id]/edit/EditNewsPageContent.tsx @@ -1,13 +1,13 @@ 'use client'; import { deleteNewsAction, patchNewsAction } from '@/actions/news'; +import { News } from '@/apis/types/news'; import NewsEditor, { NewsFormData } from '@/app/[locale]/community/news/components/NewsEditor'; -import { isLocalFile, isLocalImage, isUploadedFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { news } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { News } from '@/types/news'; +import { isLocalFile, isLocalImage, isUploadedFile } from '@/types/form'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; const newsPath = getPath(news); diff --git a/app/[locale]/community/news/[id]/page.tsx b/app/[locale]/community/news/[id]/page.tsx index e7cc08075..52834ec6d 100644 --- a/app/[locale]/community/news/[id]/page.tsx +++ b/app/[locale]/community/news/[id]/page.tsx @@ -1,12 +1,12 @@ import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getNewsDetail } from '@/apis/v1/news/[id]'; -import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PostFallback from '@/app/[locale]/community/components/PostFallback'; +import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { news } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import NewsViewer from './NewsViewer'; diff --git a/app/[locale]/community/news/components/NewsEditor.tsx b/app/[locale]/community/news/components/NewsEditor.tsx index 044efea66..bed86d114 100644 --- a/app/[locale]/community/news/components/NewsEditor.tsx +++ b/app/[locale]/community/news/components/NewsEditor.tsx @@ -1,10 +1,9 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { EditorFile, EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; import { NEWS_TAGS } from '@/constants/tag'; +import { EditorFile, EditorImage } from '@/types/form'; export interface NewsFormData { title: string; diff --git a/app/[locale]/community/news/components/NewsPageContent.tsx b/app/[locale]/community/news/components/NewsPageContent.tsx index 38c40965f..dcfddfa82 100644 --- a/app/[locale]/community/news/components/NewsPageContent.tsx +++ b/app/[locale]/community/news/components/NewsPageContent.tsx @@ -1,13 +1,13 @@ +import { NewsPreviewList } from '@/apis/types/news'; import NewsRow from '@/app/[locale]/community/news/components/NewsRow'; import LoginVisible from '@/components/common/LoginVisible'; import NoSearchResult from '@/components/common/NoSearchResult'; import Pagination from '@/components/common/Pagination'; import SearchBox from '@/components/common/search/SearchBox'; +import { news } from '@/constants/segmentNode'; import { NEWS_TAGS } from '@/constants/tag'; import { Link } from '@/i18n/routing'; -import { NewsPreviewList } from '@/types/news'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; const POST_LIMIT = 10; const newsPath = getPath(news); diff --git a/app/[locale]/community/news/components/NewsRow.tsx b/app/[locale]/community/news/components/NewsRow.tsx index 786aff16e..16ce65d2c 100644 --- a/app/[locale]/community/news/components/NewsRow.tsx +++ b/app/[locale]/community/news/components/NewsRow.tsx @@ -1,10 +1,10 @@ import PaginatedLink from '@/app/[locale]/community/components/PaginatedLink'; import ImageWithFallback from '@/components/common/ImageWithFallback'; import Tags from '@/components/common/Tags'; -import { getPath } from '@/utils/page'; import { news } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; -export interface NewsRowProps { +interface NewsRowProps { href: string; title: string; description: string; diff --git a/app/[locale]/community/news/create/page.tsx b/app/[locale]/community/news/create/page.tsx index b17768c27..a5c138341 100644 --- a/app/[locale]/community/news/create/page.tsx +++ b/app/[locale]/community/news/create/page.tsx @@ -2,11 +2,11 @@ import { postNewsAction } from '@/actions/news'; import NewsEditor, { NewsFormData } from '@/app/[locale]/community/news/components/NewsEditor'; -import { isLocalFile, isLocalImage } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { news } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { isLocalFile, isLocalImage } from '@/types/form'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; const newsPath = getPath(news); diff --git a/app/[locale]/community/news/page.tsx b/app/[locale]/community/news/page.tsx index dbfb24510..8902cf14d 100644 --- a/app/[locale]/community/news/page.tsx +++ b/app/[locale]/community/news/page.tsx @@ -4,12 +4,12 @@ export const dynamic = 'force-dynamic'; import { notFound } from 'next/navigation'; import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getNewsPosts } from '@/apis/v1/news'; import NewsPageContent from '@/app/[locale]/community/news/components/NewsPageContent'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { news } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import { validatePageNum, validateTag } from '@/utils/validateSearchParams'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { diff --git a/app/[locale]/community/notice/NoticePageContent.tsx b/app/[locale]/community/notice/NoticePageContent.tsx index 4482acf09..1fd6f1a85 100644 --- a/app/[locale]/community/notice/NoticePageContent.tsx +++ b/app/[locale]/community/notice/NoticePageContent.tsx @@ -1,11 +1,11 @@ 'use client'; +import { NoticePreviewList } from '@/apis/types/notice'; import NoticeList from '@/app/[locale]/community/notice/components/NoticeList'; import LoginVisible from '@/components/common/LoginVisible'; import Pagination from '@/components/common/Pagination'; import SearchBox from '@/components/common/search/SearchBox'; import { NOTICE_TAGS } from '@/constants/tag'; -import { NoticePreviewList } from '@/types/notice'; import AdminFeatures from './components/AdminFeatures'; import { usePostSelect } from './components/usePostSelect'; diff --git a/app/[locale]/community/notice/[id]/NoticeViewer.tsx b/app/[locale]/community/notice/[id]/NoticeViewer.tsx index b319018c7..3d8240000 100644 --- a/app/[locale]/community/notice/[id]/NoticeViewer.tsx +++ b/app/[locale]/community/notice/[id]/NoticeViewer.tsx @@ -1,15 +1,15 @@ import { useTranslations } from 'next-intl'; +import { Notice } from '@/apis/types/notice'; import PostFooter from '@/app/[locale]/community/components/PostFooter'; import Attachments from '@/components/common/Attachments'; import { StraightNode } from '@/components/common/Nodes'; import Tags from '@/components/common/Tags'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; -import { Notice } from '@/types/notice'; +import { notice } from '@/constants/segmentNode'; import { formatPostDateStr } from '@/utils/date'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; interface NoticePostPageProps { notice: Notice; diff --git a/app/[locale]/community/notice/[id]/edit/EditNoticePageContent.tsx b/app/[locale]/community/notice/[id]/edit/EditNoticePageContent.tsx index f1ec091dc..1fb735ff6 100644 --- a/app/[locale]/community/notice/[id]/edit/EditNoticePageContent.tsx +++ b/app/[locale]/community/notice/[id]/edit/EditNoticePageContent.tsx @@ -3,15 +3,15 @@ import { useTransition } from 'react'; import { deleteNoticeAction, patchNoticeAction } from '@/actions/notice'; +import { Notice } from '@/apis/types/notice'; import NoticeEditor, { NoticeFormData, } from '@/app/[locale]/community/notice/components/NoticeEditor'; -import { isLocalFile, isUploadedFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { notice } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { Notice } from '@/types/notice'; +import { isLocalFile, isUploadedFile } from '@/types/form'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/community/notice/[id]/page.tsx b/app/[locale]/community/notice/[id]/page.tsx index de4891f93..b2f91288a 100644 --- a/app/[locale]/community/notice/[id]/page.tsx +++ b/app/[locale]/community/notice/[id]/page.tsx @@ -1,12 +1,12 @@ import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getNoticePostDetail } from '@/apis/v1/notice/[id]'; -import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PostFallback from '@/app/[locale]/community/components/PostFallback'; +import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { notice } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import NoticeViewer from './NoticeViewer'; diff --git a/app/[locale]/community/notice/components/EditButtons.tsx b/app/[locale]/community/notice/components/EditButtons.tsx index 26ce85aa5..fe6232427 100644 --- a/app/[locale]/community/notice/components/EditButtons.tsx +++ b/app/[locale]/community/notice/components/EditButtons.tsx @@ -1,6 +1,6 @@ +import { notice } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; const noticePath = getPath(notice); diff --git a/app/[locale]/community/notice/components/NoticeEditor.tsx b/app/[locale]/community/notice/components/NoticeEditor.tsx index 1a0590175..ff37e5605 100644 --- a/app/[locale]/community/notice/components/NoticeEditor.tsx +++ b/app/[locale]/community/notice/components/NoticeEditor.tsx @@ -1,10 +1,9 @@ import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { EditorFile } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; import { NOTICE_TAGS } from '@/constants/tag'; +import { EditorFile } from '@/types/form'; export interface NoticeFormData { title: string; diff --git a/app/[locale]/community/notice/components/NoticeList.tsx b/app/[locale]/community/notice/components/NoticeList.tsx index 26899e1e1..6e39eed4e 100644 --- a/app/[locale]/community/notice/components/NoticeList.tsx +++ b/app/[locale]/community/notice/components/NoticeList.tsx @@ -1,7 +1,7 @@ import { Dispatch } from 'react'; +import { NoticePreview } from '@/apis/types/notice'; import NoSearchResult from '@/components/common/NoSearchResult'; -import { NoticePreview } from '@/types/notice'; import NoticeListHeader from './NoticeListHeader'; import NoticeListRow from './NoticeListRow'; diff --git a/app/[locale]/community/notice/components/NoticeListRow.tsx b/app/[locale]/community/notice/components/NoticeListRow.tsx index 6a8cb8b02..e496115bf 100644 --- a/app/[locale]/community/notice/components/NoticeListRow.tsx +++ b/app/[locale]/community/notice/components/NoticeListRow.tsx @@ -1,11 +1,11 @@ +import { NoticePreview } from '@/apis/types/notice'; import PaginatedLink from '@/app/[locale]/community/components/PaginatedLink'; +import { notice } from '@/constants/segmentNode'; import CheckboxOrange from '@/public/image/checkbox_orange.svg'; import ClipIcon from '@/public/image/clip_icon.svg'; import LockIcon from '@/public/image/lock_icon.svg'; import PinIcon from '@/public/image/pin_icon.svg'; -import { NoticePreview } from '@/types/notice'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; interface NoticeListRowProps { post: NoticePreview; diff --git a/app/[locale]/community/notice/create/page.tsx b/app/[locale]/community/notice/create/page.tsx index 173401e72..ce0a6c1ba 100644 --- a/app/[locale]/community/notice/create/page.tsx +++ b/app/[locale]/community/notice/create/page.tsx @@ -4,11 +4,11 @@ import { postNoticeAction } from '@/actions/notice'; import NoticeEditor, { NoticeFormData, } from '@/app/[locale]/community/notice/components/NoticeEditor'; -import { isLocalFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { notice } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { isLocalFile } from '@/types/form'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; const noticePath = getPath(notice); diff --git a/app/[locale]/community/notice/page.tsx b/app/[locale]/community/notice/page.tsx index 5cc2fef50..626354b24 100644 --- a/app/[locale]/community/notice/page.tsx +++ b/app/[locale]/community/notice/page.tsx @@ -4,12 +4,12 @@ export const dynamic = 'force-dynamic'; import { notFound } from 'next/navigation'; import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getNoticePosts } from '@/apis/v1/notice'; import NoticePageContent from '@/app/[locale]/community/notice/NoticePageContent'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { notice } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import { validatePageNum, validateTag } from '@/utils/validateSearchParams'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { diff --git a/app/[locale]/community/page.tsx b/app/[locale]/community/page.tsx index fc85caa98..d8d3e4da9 100644 --- a/app/[locale]/community/page.tsx +++ b/app/[locale]/community/page.tsx @@ -1,6 +1,6 @@ import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { community } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/community/seminar/SeminarContent.tsx b/app/[locale]/community/seminar/SeminarContent.tsx index f4c843d57..8b7b14483 100644 --- a/app/[locale]/community/seminar/SeminarContent.tsx +++ b/app/[locale]/community/seminar/SeminarContent.tsx @@ -1,11 +1,11 @@ import { Fragment } from 'react'; +import { SeminarPreviewList } from '@/apis/types/seminar'; import SeminarRow from '@/app/[locale]/community/seminar/components/SeminarRow'; import SeminarSearchBar from '@/app/[locale]/community/seminar/components/SeminarSearchBar'; import SeminarYear from '@/app/[locale]/community/seminar/components/SeminarYear'; import NoSearchResult from '@/components/common/NoSearchResult'; import Pagination from '@/components/common/Pagination'; -import { SeminarPreviewList } from '@/types/seminar'; const POSTS_COUNT_PER_PAGE = 10; diff --git a/app/[locale]/community/seminar/[id]/SeminarViewer.tsx b/app/[locale]/community/seminar/[id]/SeminarViewer.tsx index a88e99084..f311078c4 100644 --- a/app/[locale]/community/seminar/[id]/SeminarViewer.tsx +++ b/app/[locale]/community/seminar/[id]/SeminarViewer.tsx @@ -1,6 +1,7 @@ import { getTranslations } from 'next-intl/server'; import { ReactNode } from 'react'; +import { Seminar } from '@/apis/types/seminar'; import PostFooter from '@/app/[locale]/community/components/PostFooter'; import Attachments from '@/components/common/Attachments'; import ImageWithFallback from '@/components/common/ImageWithFallback'; @@ -8,7 +9,6 @@ import { StraightNode } from '@/components/common/Nodes'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; import { Link } from '@/i18n/routing'; -import { Seminar } from '@/types/seminar'; interface SeminarPostPageProps { seminar: Seminar; diff --git a/app/[locale]/community/seminar/[id]/edit/EditSeminarPageContent.tsx b/app/[locale]/community/seminar/[id]/edit/EditSeminarPageContent.tsx index d41a66867..a29baca85 100644 --- a/app/[locale]/community/seminar/[id]/edit/EditSeminarPageContent.tsx +++ b/app/[locale]/community/seminar/[id]/edit/EditSeminarPageContent.tsx @@ -1,15 +1,15 @@ 'use client'; import { deleteSeminarAction, patchSeminarAction } from '@/actions/seminar'; +import { Seminar } from '@/apis/types/seminar'; import SeminarEditor, { SeminarFormData, } from '@/app/[locale]/community/seminar/components/SeminarEditor'; -import { isLocalFile, isLocalImage, isUploadedFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { seminar } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; -import { Seminar } from '@/types/seminar'; +import { isLocalFile, isLocalImage, isUploadedFile } from '@/types/form'; import { getPath } from '@/utils/page'; -import { seminar } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; import { errorToast } from '@/utils/toast'; diff --git a/app/[locale]/community/seminar/[id]/page.tsx b/app/[locale]/community/seminar/[id]/page.tsx index 05754d4cf..57b0eee5e 100644 --- a/app/[locale]/community/seminar/[id]/page.tsx +++ b/app/[locale]/community/seminar/[id]/page.tsx @@ -1,12 +1,12 @@ import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getSeminarPost } from '@/apis/v1/seminar/[id]'; -import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PostFallback from '@/app/[locale]/community/components/PostFallback'; +import InvalidIDFallback from '@/components/common/InvalidIDFallback'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { seminar } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import SeminarViewer from './SeminarViewer'; diff --git a/app/[locale]/community/seminar/components/AdminFeatures.tsx b/app/[locale]/community/seminar/components/AdminFeatures.tsx index ff52d7f72..ab858d112 100644 --- a/app/[locale]/community/seminar/components/AdminFeatures.tsx +++ b/app/[locale]/community/seminar/components/AdminFeatures.tsx @@ -1,6 +1,6 @@ +import { seminar } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { seminar } from '@/constants/segmentNode'; const seminarPath = getPath(seminar); diff --git a/app/[locale]/community/seminar/components/SeminarEditor.tsx b/app/[locale]/community/seminar/components/SeminarEditor.tsx index 7e4bd6c22..c544bcdb4 100644 --- a/app/[locale]/community/seminar/components/SeminarEditor.tsx +++ b/app/[locale]/community/seminar/components/SeminarEditor.tsx @@ -3,9 +3,8 @@ import { FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import { EditorFile, EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import { EditorFile, EditorImage } from '@/types/form'; export interface SeminarFormData { title: string; diff --git a/app/[locale]/community/seminar/components/SeminarRow.tsx b/app/[locale]/community/seminar/components/SeminarRow.tsx index 8af394606..913794b00 100644 --- a/app/[locale]/community/seminar/components/SeminarRow.tsx +++ b/app/[locale]/community/seminar/components/SeminarRow.tsx @@ -1,16 +1,16 @@ import { ElementType, PropsWithChildren } from 'react'; +import { SeminarPreview } from '@/apis/types/seminar'; import PaginatedLink from '@/app/[locale]/community/components/PaginatedLink'; import ImageWithFallback from '@/components/common/ImageWithFallback'; +import { seminar } from '@/constants/segmentNode'; import Calendar from '@/public/image/calendar.svg'; import Distance from '@/public/image/distance.svg'; import Person from '@/public/image/person.svg'; -import { SeminarPreview } from '@/types/seminar'; import { formatSeminarDateStr } from '@/utils/date'; import { getPath } from '@/utils/page'; -import { seminar } from '@/constants/segmentNode'; -export interface SeminarRowProps { +interface SeminarRowProps { seminar: SeminarPreview; } diff --git a/app/[locale]/community/seminar/components/SeminarYear.tsx b/app/[locale]/community/seminar/components/SeminarYear.tsx index 6b29bc8a2..7227fb671 100644 --- a/app/[locale]/community/seminar/components/SeminarYear.tsx +++ b/app/[locale]/community/seminar/components/SeminarYear.tsx @@ -1,4 +1,4 @@ -export interface SeminarYearProps { +interface SeminarYearProps { index: number; startDate: string; } diff --git a/app/[locale]/community/seminar/create/page.tsx b/app/[locale]/community/seminar/create/page.tsx index 25cfc0ae2..8d19c63ad 100644 --- a/app/[locale]/community/seminar/create/page.tsx +++ b/app/[locale]/community/seminar/create/page.tsx @@ -4,11 +4,11 @@ import { postSeminarAction } from '@/actions/seminar'; import SeminarEditor, { SeminarFormData, } from '@/app/[locale]/community/seminar/components/SeminarEditor'; -import { isLocalFile, isLocalImage } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { seminar } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { isLocalFile, isLocalImage } from '@/types/form'; import { getPath } from '@/utils/page'; -import { seminar } from '@/constants/segmentNode'; import { encodeFormDataFileName } from '@/utils/string'; const seminarPath = getPath(seminar); diff --git a/app/[locale]/community/seminar/page.tsx b/app/[locale]/community/seminar/page.tsx index 81e4ba730..f40c510b2 100644 --- a/app/[locale]/community/seminar/page.tsx +++ b/app/[locale]/community/seminar/page.tsx @@ -4,12 +4,12 @@ export const dynamic = 'force-dynamic'; import { notFound } from 'next/navigation'; import { Suspense } from 'react'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { getSeminarPosts } from '@/apis/v1/seminar'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { PostSearchQueryParams } from '@/types/post'; -import { getMetadata } from '@/utils/metadata'; import { seminar } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; import { validatePageNum } from '@/utils/validateSearchParams'; import AdminFeatures from './components/AdminFeatures'; diff --git a/app/[locale]/components/NewsCard.tsx b/app/[locale]/components/NewsCard.tsx index 110e233a1..68afcb95f 100644 --- a/app/[locale]/components/NewsCard.tsx +++ b/app/[locale]/components/NewsCard.tsx @@ -1,7 +1,7 @@ import Image from 'next/image'; +import { MainNews } from '@/apis/types/main'; import { Link } from '@/i18n/routing'; -import { MainNews } from '@/types/main'; import { formatMainNewsDateStr } from '@/utils/date'; import { CARD_WIDTH_REM } from './constants'; diff --git a/app/[locale]/components/NewsCarousel.tsx b/app/[locale]/components/NewsCarousel.tsx index de8e394aa..1fd02639c 100644 --- a/app/[locale]/components/NewsCarousel.tsx +++ b/app/[locale]/components/NewsCarousel.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -import { MainNews } from '@/types/main'; +import { MainNews } from '@/apis/types/main'; import { animateScrollLeft } from './animateScrollTo'; import { CARD_GAP_REM } from './constants'; diff --git a/app/[locale]/components/NewsCarouselMobile.tsx b/app/[locale]/components/NewsCarouselMobile.tsx index b7b1e14cc..224170b3f 100644 --- a/app/[locale]/components/NewsCarouselMobile.tsx +++ b/app/[locale]/components/NewsCarouselMobile.tsx @@ -1,4 +1,4 @@ -import { MainNews } from '@/types/main'; +import { MainNews } from '@/apis/types/main'; import NewsCard from './NewsCard'; diff --git a/app/[locale]/components/NewsSection.tsx b/app/[locale]/components/NewsSection.tsx index b98873bdf..6a2ea9596 100644 --- a/app/[locale]/components/NewsSection.tsx +++ b/app/[locale]/components/NewsSection.tsx @@ -2,12 +2,12 @@ import { useTranslations } from 'next-intl'; +import { MainNews } from '@/apis/types/main'; +import { news } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import SmallRightArrow from '@/public/image/main/small_right_arrow.svg'; -import { MainNews } from '@/types/main'; import useResponsive from '@/utils/hooks/useResponsive'; import { getPath } from '@/utils/page'; -import { news } from '@/constants/segmentNode'; import NewsCarousel from './NewsCarousel'; import NewsCarouselMobile from './NewsCarouselMobile'; diff --git a/app/[locale]/components/NoticeSection.tsx b/app/[locale]/components/NoticeSection.tsx index db79c7a40..57c0e2eb9 100644 --- a/app/[locale]/components/NoticeSection.tsx +++ b/app/[locale]/components/NoticeSection.tsx @@ -4,13 +4,13 @@ import Image from 'next/image'; import { useTranslations } from 'next-intl'; import { ReactNode, useState } from 'react'; +import { AllMainNotice } from '@/apis/types/main'; +import { notice } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import Plus from '@/public/image/main/plus.svg'; -import { AllMainNotice } from '@/types/main'; import { formatMainNoticeDateStr } from '@/utils/date'; import useResponsive from '@/utils/hooks/useResponsive'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; export default function NoticeSection({ allMainNotice }: { allMainNotice: AllMainNotice }) { const [tag, setTag] = useState('all'); diff --git a/app/[locale]/components/useCarousel.ts b/app/[locale]/components/useCarousel.ts index b6d0c3fb1..2dd73262f 100644 --- a/app/[locale]/components/useCarousel.ts +++ b/app/[locale]/components/useCarousel.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react'; -import { MainNews } from '@/types/main'; +import { MainNews } from '@/apis/types/main'; import { AUTO_SCROLL_MS } from './constants'; import { useCarouselLayout } from './useCarouselLayout'; diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 5140c0925..623b51349 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,14 +1,12 @@ import Image from 'next/image'; import { getTranslations } from 'next-intl/server'; +import { MainImportant } from '@/apis/types/main'; import { getMain } from '@/apis/v1'; -import Header from '@/components/layout/header/Header'; import GraphicSection from '@/app/[locale]/components/GraphicSection'; import NewsSection from '@/app/[locale]/components/NewsSection'; import NoticeSection from '@/app/[locale]/components/NoticeSection'; -import { Link } from '@/i18n/routing'; -import { MainImportant } from '@/types/main'; -import { getPath } from '@/utils/page'; +import Header from '@/components/layout/header/Header'; import { degree, faculty, @@ -16,6 +14,8 @@ import { generalStudies, topConferenceList, } from '@/constants/segmentNode'; +import { Link } from '@/i18n/routing'; +import { getPath } from '@/utils/page'; export default async function MainPage() { const data = await getMain(); diff --git a/app/[locale]/people/components/HeaderAndList.tsx b/app/[locale]/people/components/HeaderAndList.tsx index c7d1744a5..b287fb1c2 100644 --- a/app/[locale]/people/components/HeaderAndList.tsx +++ b/app/[locale]/people/components/HeaderAndList.tsx @@ -1,6 +1,6 @@ import BulletRow from './BulletRow'; -export interface PeopleInfoListProps { +interface PeopleInfoListProps { header: string; list: string[]; } diff --git a/app/[locale]/people/components/PeopleCell.tsx b/app/[locale]/people/components/PeopleCell.tsx index 8510304ad..89b280f48 100644 --- a/app/[locale]/people/components/PeopleCell.tsx +++ b/app/[locale]/people/components/PeopleCell.tsx @@ -1,8 +1,6 @@ import ImageWithFallback from '@/components/common/ImageWithFallback'; import { Link } from '@/i18n/routing'; -export type PeopleType = 'FACULTY' | 'EMIRITUS_FACULTY' | 'STAFF'; - export interface PeopleCellProps { imageURL: string | null; diff --git a/app/[locale]/people/emeritus-faculty/[id]/EmeritusFacultyMemberPageContent.tsx b/app/[locale]/people/emeritus-faculty/[id]/EmeritusFacultyMemberPageContent.tsx index 7445f0cf8..10a08e4d9 100644 --- a/app/[locale]/people/emeritus-faculty/[id]/EmeritusFacultyMemberPageContent.tsx +++ b/app/[locale]/people/emeritus-faculty/[id]/EmeritusFacultyMemberPageContent.tsx @@ -3,15 +3,15 @@ import { useTranslations } from 'next-intl'; import { deleteFacultyAction } from '@/actions/people'; +import { EmeritusFaculty } from '@/apis/types/people'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { faculty } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { WithLanguage } from '@/types/language'; -import { EmeritusFaculty } from '@/types/people'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { faculty } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/people/emeritus-faculty/page.tsx b/app/[locale]/people/emeritus-faculty/page.tsx index a826966e0..f3b00f499 100644 --- a/app/[locale]/people/emeritus-faculty/page.tsx +++ b/app/[locale]/people/emeritus-faculty/page.tsx @@ -1,12 +1,12 @@ +import { SimpleEmeritusFaculty } from '@/apis/types/people'; import { getEmeritusFacultyList } from '@/apis/v2/professor/inactive'; import { CreateButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { Language } from '@/types/language'; -import { SimpleEmeritusFaculty } from '@/types/people'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { PeopleCellProps } from '../components/PeopleCell'; import PeopleGrid from '../components/PeopleGrid'; diff --git a/app/[locale]/people/faculty/[id]/FacultyMemberPageContent.tsx b/app/[locale]/people/faculty/[id]/FacultyMemberPageContent.tsx index 651a794f9..d26563b1c 100644 --- a/app/[locale]/people/faculty/[id]/FacultyMemberPageContent.tsx +++ b/app/[locale]/people/faculty/[id]/FacultyMemberPageContent.tsx @@ -3,16 +3,16 @@ import { useTranslations } from 'next-intl'; import { deleteFacultyAction } from '@/actions/people'; +import { Faculty } from '@/apis/types/people'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import { CurvedHorizontalSmallNode } from '@/components/common/Nodes'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { faculty, researchLabs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { WithLanguage } from '@/types/language'; -import { Faculty } from '@/types/people'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { faculty, researchLabs } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/people/faculty/[id]/edit/FacultyEditPageContent.tsx b/app/[locale]/people/faculty/[id]/edit/FacultyEditPageContent.tsx index 993cbae22..5fcd8b019 100644 --- a/app/[locale]/people/faculty/[id]/edit/FacultyEditPageContent.tsx +++ b/app/[locale]/people/faculty/[id]/edit/FacultyEditPageContent.tsx @@ -1,18 +1,18 @@ 'use client'; import { putFacultyAction } from '@/actions/people'; +import { Faculty } from '@/apis/types/people'; +import { SimpleResearchLab } from '@/apis/types/research'; import FacultyEditor, { FacultyFormData, } from '@/app/[locale]/people/faculty/components/FacultyEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; -import { Faculty } from '@/types/people'; -import { SimpleResearchLab } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast } from '@/utils/toast'; diff --git a/app/[locale]/people/faculty/components/FacultyEditor.tsx b/app/[locale]/people/faculty/components/FacultyEditor.tsx index f0d9d2f49..c1a44d648 100644 --- a/app/[locale]/people/faculty/components/FacultyEditor.tsx +++ b/app/[locale]/people/faculty/components/FacultyEditor.tsx @@ -3,15 +3,15 @@ import { useState } from 'react'; import { FormProvider, useForm, useFormContext, useWatch } from 'react-hook-form'; +import { FACULTY_STATUS, FacultyStatus } from '@/apis/types/people'; +import { SimpleResearchLab } from '@/apis/types/research'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; +import LanguagePicker from '@/components/form/LanguagePicker'; +import { EditorImage } from '@/types/form'; import { Language, WithLanguage } from '@/types/language'; -import { getKeys } from '@/utils/object'; -import { FACULTY_STATUS, FacultyStatus } from '@/types/people'; -import { SimpleResearchLab } from '@/types/research'; import useLanguage from '@/utils/hooks/useLanguage'; +import { getKeys } from '@/utils/object'; export type FacultyFormData = WithLanguage<{ status: FacultyStatus; diff --git a/app/[locale]/people/faculty/create/FacultyCreatePageContent.tsx b/app/[locale]/people/faculty/create/FacultyCreatePageContent.tsx index ae9c730d9..5e171a698 100644 --- a/app/[locale]/people/faculty/create/FacultyCreatePageContent.tsx +++ b/app/[locale]/people/faculty/create/FacultyCreatePageContent.tsx @@ -1,15 +1,15 @@ 'use client'; import { postFacultyAction } from '@/actions/people'; +import { FacultyStatus } from '@/apis/types/people'; +import { SimpleResearchLab } from '@/apis/types/research'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; -import { FacultyStatus } from '@/types/people'; -import { SimpleResearchLab } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { emeritusFaculty, faculty } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/people/faculty/create/page.tsx b/app/[locale]/people/faculty/create/page.tsx index 39dc3a94b..f0fae0350 100644 --- a/app/[locale]/people/faculty/create/page.tsx +++ b/app/[locale]/people/faculty/create/page.tsx @@ -1,6 +1,6 @@ +import { FacultyStatus } from '@/apis/types/people'; import { getResearchLabs } from '@/apis/v2/research/lab'; import { Language } from '@/types/language'; -import { FacultyStatus } from '@/types/people'; import FacultyCreatePageContent from './FacultyCreatePageContent'; diff --git a/app/[locale]/people/faculty/page.tsx b/app/[locale]/people/faculty/page.tsx index b4e1ae7ce..9aae4b9ce 100644 --- a/app/[locale]/people/faculty/page.tsx +++ b/app/[locale]/people/faculty/page.tsx @@ -1,12 +1,12 @@ +import { SimpleFaculty } from '@/apis/types/people'; import { getActiveFacultyList } from '@/apis/v2/professor/active'; import { CreateButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { faculty, researchLabs } from '@/constants/segmentNode'; import { Language } from '@/types/language'; -import { SimpleFaculty } from '@/types/people'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { faculty, researchLabs } from '@/constants/segmentNode'; import { PeopleCellProps } from '../components/PeopleCell'; import PeopleGrid from '../components/PeopleGrid'; diff --git a/app/[locale]/people/page.tsx b/app/[locale]/people/page.tsx index aa043474f..41958ec91 100644 --- a/app/[locale]/people/page.tsx +++ b/app/[locale]/people/page.tsx @@ -1,6 +1,6 @@ import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { people } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/people/staff/[id]/StaffMemberPageContent.tsx b/app/[locale]/people/staff/[id]/StaffMemberPageContent.tsx index 0467ac392..39e808858 100644 --- a/app/[locale]/people/staff/[id]/StaffMemberPageContent.tsx +++ b/app/[locale]/people/staff/[id]/StaffMemberPageContent.tsx @@ -3,15 +3,15 @@ import { useTranslations } from 'next-intl'; import { deleteStaffAction } from '@/actions/people'; +import { Staff } from '@/apis/types/people'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { staff } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { WithLanguage } from '@/types/language'; -import { Staff } from '@/types/people'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { staff } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/people/staff/[id]/edit/StaffEditPageContent.tsx b/app/[locale]/people/staff/[id]/edit/StaffEditPageContent.tsx index 082145eff..e376303d3 100644 --- a/app/[locale]/people/staff/[id]/edit/StaffEditPageContent.tsx +++ b/app/[locale]/people/staff/[id]/edit/StaffEditPageContent.tsx @@ -1,17 +1,17 @@ 'use client'; import { putStaffAction } from '@/actions/people'; +import { Staff } from '@/apis/types/people'; import StaffEditor, { StaffEditorFormData, } from '@/app/[locale]/people/staff/components/StaffEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { staff } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; -import { Staff } from '@/types/people'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { staff } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast } from '@/utils/toast'; diff --git a/app/[locale]/people/staff/components/StaffEditor.tsx b/app/[locale]/people/staff/components/StaffEditor.tsx index cbb1046ae..21e5b429d 100644 --- a/app/[locale]/people/staff/components/StaffEditor.tsx +++ b/app/[locale]/people/staff/components/StaffEditor.tsx @@ -4,9 +4,9 @@ import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import Fieldset from '@/components/form/Fieldset'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { EditorImage } from '@/components/form/types'; import Form from '@/components/form/Form'; +import LanguagePicker from '@/components/form/LanguagePicker'; +import { EditorImage } from '@/types/form'; import { Language, WithLanguage } from '@/types/language'; import useLanguage from '@/utils/hooks/useLanguage'; diff --git a/app/[locale]/people/staff/create/page.tsx b/app/[locale]/people/staff/create/page.tsx index 2d5725abc..8566c98f5 100644 --- a/app/[locale]/people/staff/create/page.tsx +++ b/app/[locale]/people/staff/create/page.tsx @@ -6,12 +6,12 @@ import StaffEditor, { StaffEditorFormData, } from '@/app/[locale]/people/staff/components/StaffEditor'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { staff } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language } from '@/types/language'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { getPath } from '@/utils/page'; -import { staff } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast } from '@/utils/toast'; diff --git a/app/[locale]/people/staff/page.tsx b/app/[locale]/people/staff/page.tsx index 390eea870..2369fc2e2 100644 --- a/app/[locale]/people/staff/page.tsx +++ b/app/[locale]/people/staff/page.tsx @@ -2,10 +2,10 @@ import { getStaffList } from '@/apis/v2/staff'; import { CreateButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { staff } from '@/constants/segmentNode'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { staff } from '@/constants/segmentNode'; import { PeopleCellProps } from '../components/PeopleCell'; import PeopleGrid from '../components/PeopleGrid'; diff --git a/app/[locale]/research/centers/ResearchCenterDetails.tsx b/app/[locale]/research/centers/ResearchCenterDetails.tsx index 01b6c5852..b0833b511 100644 --- a/app/[locale]/research/centers/ResearchCenterDetails.tsx +++ b/app/[locale]/research/centers/ResearchCenterDetails.tsx @@ -1,16 +1,16 @@ 'use client'; import { deleteResearchCenterAction } from '@/actions/research'; +import { ResearchCenter } from '@/apis/types/research'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionTitle from '@/components/common/selection/SelectionTitle'; import HTMLViewer from '@/components/form/html/HTMLViewer'; +import { researchCenters } from '@/constants/segmentNode'; import LinkIcon from '@/public/image/link_icon.svg'; import { WithLanguage } from '@/types/language'; -import { ResearchCenter } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { researchCenters } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/research/centers/components/ResearchCenterEditor.tsx b/app/[locale]/research/centers/components/ResearchCenterEditor.tsx index 325626cef..16e6f3548 100644 --- a/app/[locale]/research/centers/components/ResearchCenterEditor.tsx +++ b/app/[locale]/research/centers/components/ResearchCenterEditor.tsx @@ -1,19 +1,16 @@ 'use client'; -import { useRouter } from '@/i18n/routing'; -import { getPath } from '@/utils/page'; -import { researchCenters, researchGroups } from '@/constants/segmentNode'; - -import { FormProvider, useForm } from 'react-hook-form'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { Language } from '@/types/language'; import { useState } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; + import Fieldset from '@/components/form/Fieldset'; import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; -import { EditorImage } from '@/components/form/types'; - -const groupsPath = getPath(researchGroups); +import LanguagePicker from '@/components/form/LanguagePicker'; +import { researchCenters } from '@/constants/segmentNode'; +import { useRouter } from '@/i18n/routing'; +import { EditorImage } from '@/types/form'; +import { Language } from '@/types/language'; +import { getPath } from '@/utils/page'; export interface ResearchCenterFormData { ko: { name: string; description: string; websiteURL: string; type: 'centers' }; diff --git a/app/[locale]/research/centers/create/page.tsx b/app/[locale]/research/centers/create/page.tsx index 3c5e6d008..873b4a872 100644 --- a/app/[locale]/research/centers/create/page.tsx +++ b/app/[locale]/research/centers/create/page.tsx @@ -1,12 +1,12 @@ 'use client'; import { postResearchCenterAction } from '@/actions/research'; - import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; + import ResearchCenterEditor, { ResearchCenterFormData } from '../components/ResearchCenterEditor'; export default function ResearchCenterCreatePage() { diff --git a/app/[locale]/research/centers/edit/ResearchCenterEditPageContent.tsx b/app/[locale]/research/centers/edit/ResearchCenterEditPageContent.tsx index 7746b8cb1..29f90f82a 100644 --- a/app/[locale]/research/centers/edit/ResearchCenterEditPageContent.tsx +++ b/app/[locale]/research/centers/edit/ResearchCenterEditPageContent.tsx @@ -1,13 +1,14 @@ 'use client'; import { putResearchCenterAction } from '@/actions/research'; +import { ResearchCenter } from '@/apis/types/research'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { WithLanguage } from '@/types/language'; -import { ResearchCenter } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; + import ResearchCenterEditor, { ResearchCenterFormData } from '../components/ResearchCenterEditor'; export default function ResearchCenterEditPageContent({ diff --git a/app/[locale]/research/centers/page.tsx b/app/[locale]/research/centers/page.tsx index 77a57bb64..0ab2d5166 100644 --- a/app/[locale]/research/centers/page.tsx +++ b/app/[locale]/research/centers/page.tsx @@ -4,12 +4,12 @@ import { OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionList from '@/components/common/selection/SelectionList'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { researchCenters } from '@/constants/segmentNode'; import { Link, redirect } from '@/i18n/routing'; import { Language } from '@/types/language'; import { findItemBySearchParam } from '@/utils/findSelectedItem'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { researchCenters } from '@/constants/segmentNode'; import ResearchCenterDetails from './ResearchCenterDetails'; diff --git a/app/[locale]/research/groups/ResearchGroupDetails.tsx b/app/[locale]/research/groups/ResearchGroupDetails.tsx index 42c328b11..eaac2d687 100644 --- a/app/[locale]/research/groups/ResearchGroupDetails.tsx +++ b/app/[locale]/research/groups/ResearchGroupDetails.tsx @@ -4,14 +4,14 @@ import Image from 'next/image'; import { useTranslations } from 'next-intl'; import { deleteResearchGroupAction } from '@/actions/research'; +import { ResearchGroup } from '@/apis/types/research'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; +import { researchGroups } from '@/constants/segmentNode'; import { WithLanguage } from '@/types/language'; -import { ResearchGroup } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { getPath } from '@/utils/page'; -import { researchGroups } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/research/groups/ResearchGroupLabs.tsx b/app/[locale]/research/groups/ResearchGroupLabs.tsx index 58c971b6c..60ec8f179 100644 --- a/app/[locale]/research/groups/ResearchGroupLabs.tsx +++ b/app/[locale]/research/groups/ResearchGroupLabs.tsx @@ -2,9 +2,9 @@ import { useTranslations } from 'next-intl'; +import { researchLabs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { researchLabs } from '@/constants/segmentNode'; export default function ResearchGroupLabs({ labs }: { labs: { id: number; name: string }[] }) { const t = useTranslations('Content'); diff --git a/app/[locale]/research/groups/components/ResearchGroupEditor.tsx b/app/[locale]/research/groups/components/ResearchGroupEditor.tsx index 942b7dc11..a1002ffc6 100644 --- a/app/[locale]/research/groups/components/ResearchGroupEditor.tsx +++ b/app/[locale]/research/groups/components/ResearchGroupEditor.tsx @@ -1,18 +1,18 @@ 'use client'; +import { useState } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; + +import Fieldset from '@/components/form/Fieldset'; +import Form from '@/components/form/Form'; +import LanguagePicker from '@/components/form/LanguagePicker'; +import { researchGroups } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; +import { EditorImage } from '@/types/form'; +import { Language } from '@/types/language'; import { getPath } from '@/utils/page'; -import { researchGroups } from '@/constants/segmentNode'; import ResearchGroupLabsEditGuide from '../ResearchGroupLabsEditGuide'; -import { FormProvider, useForm } from 'react-hook-form'; -import LanguagePicker from '@/components/form/LanguagePicker'; -import { Language } from '@/types/language'; -import { useState } from 'react'; -import Fieldset from '@/components/form/Fieldset'; -import Form from '@/components/form/Form'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; -import { EditorImage } from '@/components/form/types'; const groupsPath = getPath(researchGroups); diff --git a/app/[locale]/research/groups/edit/ResearchGroupEditPageContent.tsx b/app/[locale]/research/groups/edit/ResearchGroupEditPageContent.tsx index 31049e6c7..2bbad4773 100644 --- a/app/[locale]/research/groups/edit/ResearchGroupEditPageContent.tsx +++ b/app/[locale]/research/groups/edit/ResearchGroupEditPageContent.tsx @@ -1,9 +1,9 @@ 'use client'; import { putResearchGroupAction } from '@/actions/research'; +import { ResearchGroup } from '@/apis/types/research'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; import { WithLanguage } from '@/types/language'; -import { ResearchGroup } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { contentToFormData } from '@/utils/formData'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/research/groups/page.tsx b/app/[locale]/research/groups/page.tsx index a2b9dccc6..09d3bbdea 100644 --- a/app/[locale]/research/groups/page.tsx +++ b/app/[locale]/research/groups/page.tsx @@ -4,12 +4,12 @@ import { OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import SelectionList from '@/components/common/selection/SelectionList'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { researchGroups } from '@/constants/segmentNode'; import { Link, redirect } from '@/i18n/routing'; import { Language } from '@/types/language'; import { findItemBySearchParam } from '@/utils/findSelectedItem'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { researchGroups } from '@/constants/segmentNode'; import ResearchGroupDetails from './ResearchGroupDetails'; diff --git a/app/[locale]/research/labs/ResearchLabListRow.tsx b/app/[locale]/research/labs/ResearchLabListRow.tsx index 7d3d701d3..470cca998 100644 --- a/app/[locale]/research/labs/ResearchLabListRow.tsx +++ b/app/[locale]/research/labs/ResearchLabListRow.tsx @@ -1,10 +1,10 @@ import { Fragment } from 'react'; +import { SimpleResearchLab } from '@/apis/types/research'; +import { faculty, researchLabs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import YoutubeIcon from '@/public/image/youtube_icon.svg'; -import { SimpleResearchLab } from '@/types/research'; import { getPath } from '@/utils/page'; -import { faculty, researchLabs } from '@/constants/segmentNode'; export const LAB_ROW_ITEM_WIDTH = { name: 'sm:w-[14.5rem]', diff --git a/app/[locale]/research/labs/[id]/ResearchLabDetailContent.tsx b/app/[locale]/research/labs/[id]/ResearchLabDetailContent.tsx index 74ccd5209..6512259ae 100644 --- a/app/[locale]/research/labs/[id]/ResearchLabDetailContent.tsx +++ b/app/[locale]/research/labs/[id]/ResearchLabDetailContent.tsx @@ -3,18 +3,18 @@ import { useTranslations } from 'next-intl'; import { deleteResearchLabAction } from '@/actions/research'; +import { ResearchLab } from '@/apis/types/research'; import { DeleteButton, EditButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import HTMLViewer from '@/components/form/html/HTMLViewer'; +import { researchGroups, researchLabs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import PentagonLong from '@/public/image/pentagon_long.svg'; import PentagonShort from '@/public/image/pentagon_short.svg'; import { WithLanguage } from '@/types/language'; -import { ResearchLab } from '@/types/research'; import { errorToStr } from '@/utils/error'; import useResponsive from '@/utils/hooks/useResponsive'; import { getPath } from '@/utils/page'; -import { researchGroups, researchLabs } from '@/constants/segmentNode'; import { handleServerAction } from '@/utils/serverActionError'; import { replaceSpaceWithDash } from '@/utils/string'; import { errorToast, successToast } from '@/utils/toast'; diff --git a/app/[locale]/research/labs/[id]/ResesarchLabInfo.tsx b/app/[locale]/research/labs/[id]/ResesarchLabInfo.tsx index cc3b4ac8c..f6ec4868c 100644 --- a/app/[locale]/research/labs/[id]/ResesarchLabInfo.tsx +++ b/app/[locale]/research/labs/[id]/ResesarchLabInfo.tsx @@ -1,11 +1,11 @@ import { Fragment } from 'react'; +import { ResearchLab } from '@/apis/types/research'; import CornerFoldedRectangle from '@/components/common/CornerFoldedRectangle'; import { COLOR_THEME } from '@/constants/color'; +import { faculty } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; -import { ResearchLab } from '@/types/research'; import { getPath } from '@/utils/page'; -import { faculty } from '@/constants/segmentNode'; export default function ResearchLabInfo({ lab }: { lab: ResearchLab }) { const dropShadow = 'drop-shadow(1px 2px 2px rgba(0,0,0,0.25))'; diff --git a/app/[locale]/research/labs/[id]/edit/ResearchLabEditPageContent.tsx b/app/[locale]/research/labs/[id]/edit/ResearchLabEditPageContent.tsx index 6fbe39d36..c4d3a43f3 100644 --- a/app/[locale]/research/labs/[id]/edit/ResearchLabEditPageContent.tsx +++ b/app/[locale]/research/labs/[id]/edit/ResearchLabEditPageContent.tsx @@ -1,14 +1,14 @@ 'use client'; import { putResearchLabAction } from '@/actions/research'; +import { SimpleFaculty } from '@/apis/types/people'; +import { ResearchGroup, ResearchLab } from '@/apis/types/research'; import ResearchLabEditor, { ResearchLabFormData, } from '@/app/[locale]/research/labs/components/ResearchLabEditor'; -import { isLocalFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { isLocalFile } from '@/types/form'; import { WithLanguage } from '@/types/language'; -import { SimpleFaculty } from '@/types/people'; -import { ResearchGroup, ResearchLab } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; import { encodeFormDataFileName } from '@/utils/string'; diff --git a/app/[locale]/research/labs/components/ResearchLabEditor.tsx b/app/[locale]/research/labs/components/ResearchLabEditor.tsx index 5060614ef..19978b979 100644 --- a/app/[locale]/research/labs/components/ResearchLabEditor.tsx +++ b/app/[locale]/research/labs/components/ResearchLabEditor.tsx @@ -3,18 +3,17 @@ import { useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; +import { SimpleFaculty } from '@/apis/types/people'; +import { ResearchGroup } from '@/apis/types/research'; +import { researchLabs } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import { Language, WithLanguage } from '@/types/language'; -import { SimpleFaculty } from '@/types/people'; -import { ResearchGroup } from '@/types/research'; import { getPath } from '@/utils/page'; -import { researchLabs } from '@/constants/segmentNode'; import Fieldset from '../../../../../components/form/Fieldset'; -import LanguagePicker from '../../../../../components/form/LanguagePicker'; -import { EditorFile } from '../../../../../components/form/types'; import Form from '../../../../../components/form/Form'; -import HTMLEditor from '../../../../../components/form/html/HTMLEditor'; +import LanguagePicker from '../../../../../components/form/LanguagePicker'; +import { EditorFile } from '../../../../../types/form'; export type ResearchLabFormData = WithLanguage<{ name: string; diff --git a/app/[locale]/research/labs/create/ResearchLabCreatePageContent.tsx b/app/[locale]/research/labs/create/ResearchLabCreatePageContent.tsx index 710c60eb3..da3e7da33 100644 --- a/app/[locale]/research/labs/create/ResearchLabCreatePageContent.tsx +++ b/app/[locale]/research/labs/create/ResearchLabCreatePageContent.tsx @@ -1,14 +1,14 @@ 'use client'; import { postResearchLabAction } from '@/actions/research'; +import { SimpleFaculty } from '@/apis/types/people'; +import { ResearchGroup } from '@/apis/types/research'; import ResearchLabEditor, { ResearchLabFormData, } from '@/app/[locale]/research/labs/components/ResearchLabEditor'; -import { isLocalFile } from '@/components/form/types'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { isLocalFile } from '@/types/form'; import { WithLanguage } from '@/types/language'; -import { SimpleFaculty } from '@/types/people'; -import { ResearchGroup } from '@/types/research'; import { errorToStr } from '@/utils/error'; import { handleServerAction } from '@/utils/serverActionError'; import { encodeFormDataFileName } from '@/utils/string'; diff --git a/app/[locale]/research/labs/page.tsx b/app/[locale]/research/labs/page.tsx index 6f784e6f6..f7d656796 100644 --- a/app/[locale]/research/labs/page.tsx +++ b/app/[locale]/research/labs/page.tsx @@ -2,11 +2,11 @@ import { getResearchLabs } from '@/apis/v2/research/lab'; import { OrangeButton } from '@/components/common/Buttons'; import LoginVisible from '@/components/common/LoginVisible'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { researchLabs } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { Language } from '@/types/language'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { researchLabs } from '@/constants/segmentNode'; import ResearchLabListHeader from './ResearchLabListHeader'; import ResearchLabListRow from './ResearchLabListRow'; diff --git a/app/[locale]/research/page.tsx b/app/[locale]/research/page.tsx index 0ffa1ccf9..3e258f4dd 100644 --- a/app/[locale]/research/page.tsx +++ b/app/[locale]/research/page.tsx @@ -1,6 +1,6 @@ import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { research } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/research/top-conference-list/ConferenceListTable.tsx b/app/[locale]/research/top-conference-list/ConferenceListTable.tsx index 728b17c0d..a6c00c8fc 100644 --- a/app/[locale]/research/top-conference-list/ConferenceListTable.tsx +++ b/app/[locale]/research/top-conference-list/ConferenceListTable.tsx @@ -1,12 +1,12 @@ import { useTranslations } from 'next-intl'; -export interface ConferenceListTableProps { +interface ConferenceListTableProps { id: number; abbreviation: string; name: string; } -export interface ConferenceRowProps { +interface ConferenceRowProps { index: number; conference: ConferenceListTableProps; } diff --git a/app/[locale]/research/top-conference-list/page.tsx b/app/[locale]/research/top-conference-list/page.tsx index 5c7a8f389..8ef3a26c0 100644 --- a/app/[locale]/research/top-conference-list/page.tsx +++ b/app/[locale]/research/top-conference-list/page.tsx @@ -3,8 +3,8 @@ import { getTranslations } from 'next-intl/server'; import { getTopConferenceList } from '@/apis/v1/conference/page'; import ConferenceListTable from '@/app/[locale]/research/top-conference-list/ConferenceListTable'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; -import { getMetadata } from '@/utils/metadata'; import { topConferenceList } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }> }) { const params = await props.params; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarColumn.tsx b/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarColumn.tsx index 4a01aa8aa..a2cc2cebb 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarColumn.tsx +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarColumn.tsx @@ -1,4 +1,4 @@ -import { ReservationPreview } from '@/types/reservation'; +import { ReservationPreview } from '@/apis/types/reservation'; import ReservationModalButton from '../modals/ReservationDetailModal'; import styles from './cellstyle.module.css'; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarContent.tsx b/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarContent.tsx index 5e7961e5b..f58d19c41 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarContent.tsx +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/calendar/CalendarContent.tsx @@ -1,6 +1,6 @@ 'use client'; -import { ReservationPreview } from '@/types/reservation'; +import { ReservationPreview } from '@/apis/types/reservation'; import { isSameDay } from '@/utils/date'; import useResponsive from '@/utils/hooks/useResponsive'; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/MiddleForm.tsx b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/MiddleForm.tsx index a7f7f4247..57ff69cd5 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/MiddleForm.tsx +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/MiddleForm.tsx @@ -1,4 +1,4 @@ -import { ReservationPostBody } from '@/types/reservation'; +import { ReservationPostBody } from '@/apis/types/reservation'; import { SetReservationBody } from './useAddReservation'; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/ReservationDetailModal.tsx b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/ReservationDetailModal.tsx index d5ec99944..757184993 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/ReservationDetailModal.tsx +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/ReservationDetailModal.tsx @@ -7,10 +7,10 @@ import { deleteSingleReservation, getReservation, } from '@/actions/reservation'; +import { Reservation } from '@/apis/types/reservation'; import LoginVisible from '@/components/common/LoginVisible'; import AlertModal from '@/components/modal/AlertModal'; import ModalFrame from '@/components/modal/ModalFrame'; -import { Reservation } from '@/types/reservation'; import useModal from '@/utils/hooks/useModal'; import { refreshPage } from '@/utils/refreshPage'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/TopForm.tsx b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/TopForm.tsx index f60d18129..2916e4101 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/TopForm.tsx +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/TopForm.tsx @@ -1,9 +1,9 @@ import { MouseEventHandler, ReactNode } from 'react'; +import { ReservationPostBody } from '@/apis/types/reservation'; import MuiDateSelector from '@/components/common/MuiDateSelector'; import Dropdown from '@/components/form/legacy/Dropdown'; import ModalFrame from '@/components/modal/ModalFrame'; -import { ReservationPostBody } from '@/types/reservation'; import { isSameDay } from '@/utils/date'; import useModal from '@/utils/hooks/useModal'; diff --git a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/useAddReservation.ts b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/useAddReservation.ts index be100abbf..b8869efe1 100644 --- a/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/useAddReservation.ts +++ b/app/[locale]/reservations/[roomType]/[roomName]/helper/modals/useAddReservation.ts @@ -1,7 +1,7 @@ import { FormEventHandler, useState } from 'react'; import { postReservation } from '@/actions/reservation'; -import { ReservationPostBody } from '@/types/reservation'; +import { ReservationPostBody } from '@/apis/types/reservation'; import { isSameDay } from '@/utils/date'; import { refreshPage } from '@/utils/refreshPage'; import { handleServerAction } from '@/utils/serverActionError'; diff --git a/app/[locale]/reservations/introduction/page.tsx b/app/[locale]/reservations/introduction/page.tsx index 1f6de7f3a..2259bed20 100644 --- a/app/[locale]/reservations/introduction/page.tsx +++ b/app/[locale]/reservations/introduction/page.tsx @@ -4,9 +4,9 @@ import SelectionList from '@/components/common/selection/SelectionList'; import SelectionTitle from '@/components/common/selection/SelectionTitle'; import HTMLViewer from '@/components/form/html/HTMLViewer'; import PageLayout from '@/components/layout/pageLayout/PageLayout'; +import { reservationIntroduction } from '@/constants/segmentNode'; import { getMetadata } from '@/utils/metadata'; import { getPath } from '@/utils/page'; -import { reservationIntroduction } from '@/constants/segmentNode'; import { replaceDashWithSpace } from '@/utils/string'; export async function generateMetadata(props: { diff --git a/app/[locale]/reservations/page.tsx b/app/[locale]/reservations/page.tsx index 33047e859..78f09a809 100644 --- a/app/[locale]/reservations/page.tsx +++ b/app/[locale]/reservations/page.tsx @@ -1,8 +1,8 @@ import { Metadata } from 'next'; import MajorCategoryPageLayout from '@/components/layout/pageLayout/MajorCategoryPageLayout'; -import { getMetadata } from '@/utils/metadata'; import { reservations } from '@/constants/segmentNode'; +import { getMetadata } from '@/utils/metadata'; export async function generateMetadata(props: { params: Promise<{ locale: string }>; diff --git a/app/[locale]/search/AboutSection.tsx b/app/[locale]/search/AboutSection.tsx index af34b5101..96e772230 100644 --- a/app/[locale]/search/AboutSection.tsx +++ b/app/[locale]/search/AboutSection.tsx @@ -1,5 +1,4 @@ -import { AboutPreview, AboutSearchResult } from '@/types/search'; -import { getPath } from '@/utils/page'; +import { AboutPreview, AboutSearchResult } from '@/apis/types/search'; import { contact, directions, @@ -10,6 +9,7 @@ import { overview, studentClubs, } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import BasicRow from './helper/BasicRow'; import Section from './helper/Section'; diff --git a/app/[locale]/search/AcademicSection.tsx b/app/[locale]/search/AcademicSection.tsx index 778e18276..3cfdd559f 100644 --- a/app/[locale]/search/AcademicSection.tsx +++ b/app/[locale]/search/AcademicSection.tsx @@ -1,5 +1,4 @@ -import { Academic, AcademicsSearchResult } from '@/types/search'; -import { getPath } from '@/utils/page'; +import { Academic, AcademicsSearchResult } from '@/apis/types/search'; import { curriculum, degree, @@ -13,6 +12,7 @@ import { undergraduateGuide, undergraduateScholarship, } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import BasicRow from './helper/BasicRow'; import Section from './helper/Section'; diff --git a/app/[locale]/search/AdmissionSection.tsx b/app/[locale]/search/AdmissionSection.tsx index c22fd8c25..2fe9e34db 100644 --- a/app/[locale]/search/AdmissionSection.tsx +++ b/app/[locale]/search/AdmissionSection.tsx @@ -1,6 +1,6 @@ -import { AdmissionsSearchResult } from '@/types/search'; -import { getPath } from '@/utils/page'; +import { AdmissionsSearchResult } from '@/apis/types/search'; import { admissions } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import BasicRow from './helper/BasicRow'; import Section from './helper/Section'; diff --git a/app/[locale]/search/CommunitySection.tsx b/app/[locale]/search/CommunitySection.tsx index bbd39aa17..568c51ff5 100644 --- a/app/[locale]/search/CommunitySection.tsx +++ b/app/[locale]/search/CommunitySection.tsx @@ -1,11 +1,11 @@ import { useTranslations } from 'next-intl'; import { ReactNode } from 'react'; +import { NewsSearchResult, NoticeSearchResult } from '@/apis/types/search'; +import { SeminarPreviewList } from '@/apis/types/seminar'; +import { news, notice, seminar } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; -import { NewsSearchResult, NoticeSearchResult } from '@/types/search'; -import { SeminarPreviewList } from '@/types/seminar'; import { getPath } from '@/utils/page'; -import { news, notice, seminar } from '@/constants/segmentNode'; import SeminarRow from '../community/seminar/components/SeminarRow'; import CircleTitle from './helper/CircleTitle'; diff --git a/app/[locale]/search/MemberSection.tsx b/app/[locale]/search/MemberSection.tsx index aac393b15..4f4f1b88d 100644 --- a/app/[locale]/search/MemberSection.tsx +++ b/app/[locale]/search/MemberSection.tsx @@ -1,8 +1,8 @@ +import { Member, MemberSearchResult } from '@/apis/types/search'; import ImageWithFallback from '@/components/common/ImageWithFallback'; +import { faculty, staff } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; -import { Member, MemberSearchResult } from '@/types/search'; import { getPath } from '@/utils/page'; -import { faculty, staff } from '@/constants/segmentNode'; import CircleTitle from './helper/CircleTitle'; import Divider from './helper/Divider'; diff --git a/app/[locale]/search/ResearchSection.tsx b/app/[locale]/search/ResearchSection.tsx index cde583973..b22c6e852 100644 --- a/app/[locale]/search/ResearchSection.tsx +++ b/app/[locale]/search/ResearchSection.tsx @@ -1,11 +1,11 @@ -import { ResearchSearchResult, ResearchType } from '@/types/search'; -import { getPath } from '@/utils/page'; +import { ResearchSearchResult, ResearchType } from '@/apis/types/search'; import { researchCenters, researchGroups, researchLabs, topConferenceList, } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; import BasicRow from './helper/BasicRow'; import Section from './helper/Section'; diff --git a/app/[locale]/search/fetchContent.ts b/app/[locale]/search/fetchContent.ts index a681bca09..81dc631ba 100644 --- a/app/[locale]/search/fetchContent.ts +++ b/app/[locale]/search/fetchContent.ts @@ -1,11 +1,3 @@ -import { searchAbout } from '@/apis/v1/about/search/top'; -import { searchAcademics } from '@/apis/v1/academics/search/top'; -import { searchAdmissions } from '@/apis/v1/admissions/search/top'; -import { searchMember } from '@/apis/v1/member/search/top'; -import { searchNews } from '@/apis/v1/news/totalSearch'; -import { searchNotice } from '@/apis/v1/notice/totalSearch'; -import { getSeminarPosts } from '@/apis/v1/seminar'; -import { searchResearch } from '@/apis/v2/research/search/top'; import { AboutSearchResult, AcademicsSearchResult, @@ -14,8 +6,16 @@ import { NewsSearchResult, NoticeSearchResult, ResearchSearchResult, -} from '@/types/search'; -import { SeminarPreviewList } from '@/types/seminar'; +} from '@/apis/types/search'; +import { SeminarPreviewList } from '@/apis/types/seminar'; +import { searchAbout } from '@/apis/v1/about/search/top'; +import { searchAcademics } from '@/apis/v1/academics/search/top'; +import { searchAdmissions } from '@/apis/v1/admissions/search/top'; +import { searchMember } from '@/apis/v1/member/search/top'; +import { searchNews } from '@/apis/v1/news/totalSearch'; +import { searchNotice } from '@/apis/v1/notice/totalSearch'; +import { getSeminarPosts } from '@/apis/v1/seminar'; +import { searchResearch } from '@/apis/v2/research/search/top'; import { TreeNode } from './helper/SearchSubNavbar'; diff --git a/app/[locale]/search/helper/BasicRow.tsx b/app/[locale]/search/helper/BasicRow.tsx index 26cc09095..5ee43c8c9 100644 --- a/app/[locale]/search/helper/BasicRow.tsx +++ b/app/[locale]/search/helper/BasicRow.tsx @@ -1,7 +1,7 @@ import RangeBolded from '@/components/common/RangeBolded'; +import { SegmentNode } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { SegmentNode } from '@/constants/segmentNode'; type BasicRowProps = { href: string; diff --git a/app/[locale]/search/helper/NewsRow.tsx b/app/[locale]/search/helper/NewsRow.tsx index 5bccd5908..c6760e022 100644 --- a/app/[locale]/search/helper/NewsRow.tsx +++ b/app/[locale]/search/helper/NewsRow.tsx @@ -1,7 +1,7 @@ import ImageWithFallback from '@/components/common/ImageWithFallback'; import { Link } from '@/i18n/routing'; -export interface NewsRowProps { +interface NewsRowProps { href: string; title: string; date: Date; diff --git a/app/[locale]/search/helper/NoticeRow.tsx b/app/[locale]/search/helper/NoticeRow.tsx index 15926d496..50566b8a1 100644 --- a/app/[locale]/search/helper/NoticeRow.tsx +++ b/app/[locale]/search/helper/NoticeRow.tsx @@ -1,7 +1,7 @@ import RangeBolded from '@/components/common/RangeBolded'; +import { notice } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { notice } from '@/constants/segmentNode'; interface NoticeRowProps { id: number; diff --git a/app/[locale]/search/helper/SearchForm.tsx b/app/[locale]/search/helper/SearchForm.tsx deleted file mode 100644 index 984de1350..000000000 --- a/app/[locale]/search/helper/SearchForm.tsx +++ /dev/null @@ -1,37 +0,0 @@ -'use client'; - -import { ChangeEventHandler, FormEventHandler, useState } from 'react'; - -import { useRouter } from '@/i18n/routing'; - -export default function SearchForm({ query }: { query: string }) { - const [text, setText] = useState(query); - const router = useRouter(); - - const handleChange: ChangeEventHandler = (e) => { - setText(e.target.value); - }; - - const searchText: FormEventHandler = (e) => { - e.preventDefault(); - const query = text.trim(); - if (query) { - router.push(`/search?query=${query}`); - } - }; - - return ( -
- - -
- ); -} diff --git a/app/[locale]/search/page.tsx b/app/[locale]/search/page.tsx index 1ced3f61e..5d6c1cf5e 100644 --- a/app/[locale]/search/page.tsx +++ b/app/[locale]/search/page.tsx @@ -5,10 +5,10 @@ import { ReactNode } from 'react'; import SearchBox from '@/components/common/search/SearchBox'; import Header from '@/components/layout/header/Header'; import PageTitle from '@/components/layout/pageLayout/PageTitle'; +import { main } from '@/constants/segmentNode'; import { SEARCH_TAGS } from '@/constants/tag'; import MagnificentGlass from '@/public/image/search/magnificent_glass.svg'; import { getMetadata } from '@/utils/metadata'; -import { main } from '@/constants/segmentNode'; import AboutSection from './AboutSection'; import AcademicSection from './AcademicSection'; diff --git a/components/common/Accordion.tsx b/components/common/Accordion.tsx deleted file mode 100644 index 3259d482c..000000000 --- a/components/common/Accordion.tsx +++ /dev/null @@ -1,31 +0,0 @@ -'use client'; - -import { useReducer } from 'react'; - -import HTMLViewer from '@/components/form/html/HTMLViewer'; - -interface AccordionProps { - title: string; - content: string; -} - -export default function Accordion({ title, content }: AccordionProps) { - const [isExpanded, toggleExpand] = useReducer((x) => !x, false); - - return ( -
-

- - {isExpanded ? 'expand_less' : 'expand_more'} - - {title} -

- - {/* TODO: 펼쳐질 때 애니메이션 */} - {isExpanded && } -
- ); -} diff --git a/components/form/File.tsx b/components/form/File.tsx index ecf82907f..f51f32475 100644 --- a/components/form/File.tsx +++ b/components/form/File.tsx @@ -3,7 +3,7 @@ import { RegisterOptions, useFormContext, useWatch } from 'react-hook-form'; import ClearIcon from '@/public/image/clear_icon.svg'; -import { LocalFile, EditorFile } from './types'; +import { EditorFile, LocalFile } from '../../types/form'; interface FilePickerProps { name: string; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 6d4780f36..4ebd6c2ba 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -6,7 +6,7 @@ import Checkbox from '@/components/form/Checkbox'; import DateSelector from '@/components/form/Date'; import Dropdown from '@/components/form/Dropdown'; import FilePicker from '@/components/form/File'; -import HTMLEditor from '@/components/form/html/HTMLEditor'; +import LazyHTMLEditor from '@/components/form/html/LazyHTMLEditor'; import ImagePicker from '@/components/form/Image'; import Radio from '@/components/form/Radio'; import Section from '@/components/form/Section'; @@ -31,5 +31,5 @@ export default Object.assign(Form, { Dropdown, Section, TextArea, - HTML: HTMLEditor, + HTML: LazyHTMLEditor, }); diff --git a/components/form/Image.tsx b/components/form/Image.tsx index dcf31027b..d309a0a74 100644 --- a/components/form/Image.tsx +++ b/components/form/Image.tsx @@ -2,7 +2,7 @@ import Image from 'next/image'; import { ChangeEventHandler, MouseEventHandler, useEffect, useState } from 'react'; import { RegisterOptions, useFormContext, useWatch } from 'react-hook-form'; -import { LocalImage, UploadedImage } from './types'; +import { LocalImage, UploadedImage } from '../../types/form'; interface Props { name: string; diff --git a/components/form/Text.tsx b/components/form/Text.tsx index f250af2da..cbd250e54 100644 --- a/components/form/Text.tsx +++ b/components/form/Text.tsx @@ -1,7 +1,7 @@ import { InputHTMLAttributes } from 'react'; import { RegisterOptions, useFormContext } from 'react-hook-form'; -export interface BasicTextInputProps extends InputHTMLAttributes { +interface BasicTextInputProps extends InputHTMLAttributes { name: string; options?: RegisterOptions; maxWidth?: string; diff --git a/components/form/html/HTMLEditor.tsx b/components/form/html/HTMLEditor.tsx index 54092fd34..72fa7d436 100644 --- a/components/form/html/HTMLEditor.tsx +++ b/components/form/html/HTMLEditor.tsx @@ -13,13 +13,13 @@ import plugins from 'suneditor/src/plugins'; import { postImage } from '@/apis/v1/file/upload'; import { isContentEmpty } from '@/utils/post'; -interface Props { +export interface HTMLEditorProps { name: string; options?: RegisterOptions; } // MEMO: defaultValues에 비동기 함수를 건네도 동작할지 모르겠음. -export default function HTMLEditor({ name, options: registerOptions }: Props) { +export default function HTMLEditor({ name, options: registerOptions }: HTMLEditorProps) { const { register, setValue, getValues } = useFormContext(); const [div, setDiv] = useState(null); const { onBlur } = register(name, registerOptions); diff --git a/components/form/html/SunEditorFallback.tsx b/components/form/html/HTMLEditorFallback.tsx similarity index 92% rename from components/form/html/SunEditorFallback.tsx rename to components/form/html/HTMLEditorFallback.tsx index 9433141b6..428d838d6 100644 --- a/components/form/html/SunEditorFallback.tsx +++ b/components/form/html/HTMLEditorFallback.tsx @@ -1,4 +1,4 @@ -export default function SunEditorFallback() { +export default function HTMLEditorFallback() { return (
diff --git a/components/form/html/HTMLViewer.tsx b/components/form/html/HTMLViewer.tsx index 4aedceee0..539deb10f 100644 --- a/components/form/html/HTMLViewer.tsx +++ b/components/form/html/HTMLViewer.tsx @@ -50,7 +50,7 @@ function TopRightComponent({ content }: TopRightComponent) { return
{content}
; } -export type TopRightImage = { +type TopRightImage = { type: 'image'; url: string; widthPX: number; diff --git a/components/form/html/LazyHTMLEditor.tsx b/components/form/html/LazyHTMLEditor.tsx new file mode 100644 index 000000000..51e4021f6 --- /dev/null +++ b/components/form/html/LazyHTMLEditor.tsx @@ -0,0 +1,14 @@ +import { lazy, Suspense } from 'react'; + +import { HTMLEditorProps } from '@/components/form/html/HTMLEditor'; +import HTMLEditorFallback from '@/components/form/html/HTMLEditorFallback'; + +const HTMLEditor = lazy(() => import('./HTMLEditor')); + +export default function LazyHTMLEditor(props: HTMLEditorProps) { + return ( + }> + + + ); +} diff --git a/components/form/types.ts b/components/form/types.ts deleted file mode 100644 index fbaab8bef..000000000 --- a/components/form/types.ts +++ /dev/null @@ -1,43 +0,0 @@ -// 첨부파일 - -export type EditorFile = LocalFile | UploadedFile; - -export interface LocalFile { - type: 'LOCAL_FILE'; - file: File; -} - -export interface UploadedFile { - type: 'UPLOADED_FILE'; - file: { - id: number; - name: string; - url: string; - bytes: number; - }; -} - -export const isLocalFile = (file: EditorFile): file is LocalFile => file.type === 'LOCAL_FILE'; - -export const isUploadedFile = (file: EditorFile): file is UploadedFile => - file.type === 'UPLOADED_FILE'; - -// 이미지 - -export type EditorImage = LocalImage | UploadedImage | null; - -export interface LocalImage { - type: 'LOCAL_IMAGE'; - file: File; -} - -export interface UploadedImage { - type: 'UPLOADED_IMAGE'; - url: string; -} - -export const isLocalImage = (image: LocalImage | UploadedImage): image is LocalImage => - image.type === 'LOCAL_IMAGE'; - -export const isUploadedImage = (image: LocalImage | UploadedImage): image is LocalImage => - image.type === 'UPLOADED_IMAGE'; diff --git a/components/layout/LoadingFallback.tsx b/components/layout/LoadingFallback.tsx deleted file mode 100644 index 7f759c49f..000000000 --- a/components/layout/LoadingFallback.tsx +++ /dev/null @@ -1,15 +0,0 @@ -export default function LoadingFallback() { - return ( -
-
-
-
-
-
-
-
-
-
-
- ); -} diff --git a/components/layout/footer/constants.ts b/components/layout/footer/constants.ts index 690fc798a..05eff2957 100644 --- a/components/layout/footer/constants.ts +++ b/components/layout/footer/constants.ts @@ -1,4 +1,3 @@ -import { getPath } from '@/utils/page'; import { contact, directions, @@ -15,6 +14,7 @@ import { topConferenceList, undergraduateGuide, } from '@/constants/segmentNode'; +import { getPath } from '@/utils/page'; export interface FooterLink { href: string; diff --git a/components/layout/footer/useFooterDesignMode.ts b/components/layout/footer/useFooterDesignMode.ts index 0e4c7c290..6c97d8dcb 100644 --- a/components/layout/footer/useFooterDesignMode.ts +++ b/components/layout/footer/useFooterDesignMode.ts @@ -1,4 +1,3 @@ -import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; import { about, academics, @@ -10,6 +9,7 @@ import { reservations, SegmentNode, } from '@/constants/segmentNode'; +import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; export type FooterMode = 'light' | 'dark'; diff --git a/components/layout/header/MobileNavButton.tsx b/components/layout/header/MobileNavButton.tsx index 9705a1c5a..82686a02d 100644 --- a/components/layout/header/MobileNavButton.tsx +++ b/components/layout/header/MobileNavButton.tsx @@ -1,9 +1,9 @@ 'use client'; +import { about, main as mainNode, SegmentNode } from '@/constants/segmentNode'; import { useNavbarContext } from '@/contexts/NavbarContext'; import MenuSVG from '@/public/image/header/menu.svg'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; -import { about, main as mainNode, SegmentNode } from '@/constants/segmentNode'; export default function MobileNavButton() { const { navbarState, toggle } = useMobileNav(); diff --git a/components/layout/navbar/MobileNav.tsx b/components/layout/navbar/MobileNav.tsx index 650d7bced..cdb028b5e 100644 --- a/components/layout/navbar/MobileNav.tsx +++ b/components/layout/navbar/MobileNav.tsx @@ -3,13 +3,13 @@ import { useTranslations } from 'next-intl'; import { useState } from 'react'; +import { main, SegmentNode } from '@/constants/segmentNode'; import { useNavbarContext } from '@/contexts/NavbarContext'; import { useSessionContext } from '@/contexts/SessionContext'; import { useRouter } from '@/i18n/routing'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; import useLanguage from '@/utils/hooks/useLanguage'; import { isAncestorNode } from '@/utils/page'; -import { main, SegmentNode } from '@/constants/segmentNode'; import MobileNavDetail from './MobileNavDetail'; diff --git a/components/layout/navbar/MobileNavDetail.tsx b/components/layout/navbar/MobileNavDetail.tsx index 4c7254c85..afcaf1888 100644 --- a/components/layout/navbar/MobileNavDetail.tsx +++ b/components/layout/navbar/MobileNavDetail.tsx @@ -1,6 +1,6 @@ +import { SegmentNode } from '@/constants/segmentNode'; import { useNavbarContext } from '@/contexts/NavbarContext'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; -import { SegmentNode } from '@/constants/segmentNode'; import NavTreeLabel from './NavtreeRow'; diff --git a/components/layout/navbar/NavbarDetail.tsx b/components/layout/navbar/NavbarDetail.tsx index 19ba63a98..fa5c60314 100644 --- a/components/layout/navbar/NavbarDetail.tsx +++ b/components/layout/navbar/NavbarDetail.tsx @@ -1,6 +1,6 @@ +import { SegmentNode } from '@/constants/segmentNode'; import { useNavbarContext } from '@/contexts/NavbarContext'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; -import { SegmentNode } from '@/constants/segmentNode'; import NavTreeLabel from './NavtreeRow'; diff --git a/components/layout/navbar/NavbarRoot.tsx b/components/layout/navbar/NavbarRoot.tsx index fc73951a2..141e83b3e 100644 --- a/components/layout/navbar/NavbarRoot.tsx +++ b/components/layout/navbar/NavbarRoot.tsx @@ -1,5 +1,6 @@ import { useTranslations } from 'next-intl'; +import { main as mainSegmentNode, SegmentNode } from '@/constants/segmentNode'; import { useNavbarContext } from '@/contexts/NavbarContext'; import { Link } from '@/i18n/routing'; import DotEmpty from '@/public/image/navbar/dot_empty.svg'; @@ -7,7 +8,6 @@ import DotFill from '@/public/image/navbar/dot_fill.svg'; import SnuLogo from '@/public/image/SNU_Logo.svg'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; import { getPath, isAncestorNode } from '@/utils/page'; -import { main as mainSegmentNode, SegmentNode } from '@/constants/segmentNode'; export const NAVBAR_CLOSED_WIDTH_REM = 6.25; export const NAVBAR_EXPANDED_WIDTH_REM = 11; diff --git a/components/layout/navbar/NavtreeRow.tsx b/components/layout/navbar/NavtreeRow.tsx index 37b19f8c2..3473ce9e6 100644 --- a/components/layout/navbar/NavtreeRow.tsx +++ b/components/layout/navbar/NavtreeRow.tsx @@ -2,9 +2,9 @@ import { StraightNode } from '@/components/common/Nodes'; import NavLabel from '@/components/layout/navbar/NavLabel'; +import { SegmentNode } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getPath } from '@/utils/page'; -import { SegmentNode } from '@/constants/segmentNode'; type NavTreeRowProps = { segmentNode: SegmentNode; diff --git a/components/layout/pageLayout/MajorCategoryPageLayout.tsx b/components/layout/pageLayout/MajorCategoryPageLayout.tsx index f052dabe7..96dd12a1c 100644 --- a/components/layout/pageLayout/MajorCategoryPageLayout.tsx +++ b/components/layout/pageLayout/MajorCategoryPageLayout.tsx @@ -4,10 +4,10 @@ import { useTranslations } from 'next-intl'; import { useState } from 'react'; import HTMLViewer from '@/components/form/html/HTMLViewer'; +import { SegmentNode } from '@/constants/segmentNode'; import { useRouter } from '@/i18n/routing'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; import { getPath } from '@/utils/page'; -import { SegmentNode } from '@/constants/segmentNode'; import ENG_NAMES from '../../../messages/en.json'; import Header from '../header/Header'; diff --git a/components/layout/pageLayout/PageLayout.tsx b/components/layout/pageLayout/PageLayout.tsx index 3aa53b926..df5eb3a53 100644 --- a/components/layout/pageLayout/PageLayout.tsx +++ b/components/layout/pageLayout/PageLayout.tsx @@ -1,7 +1,7 @@ 'use client'; import { useTranslations } from 'next-intl'; -import { CSSProperties, ReactNode, type JSX } from 'react'; +import { CSSProperties, type JSX, ReactNode } from 'react'; import SubNavbar from '@/components/layout/pageLayout/SubNavbar'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; diff --git a/components/layout/pageLayout/PageTitle.tsx b/components/layout/pageLayout/PageTitle.tsx index e41a7847e..c286b27c0 100644 --- a/components/layout/pageLayout/PageTitle.tsx +++ b/components/layout/pageLayout/PageTitle.tsx @@ -4,11 +4,11 @@ import { useTranslations } from 'next-intl'; import { Fragment, type JSX } from 'react'; import { CurvedHorizontalNodeGray } from '@/components/common/Nodes'; +import { SegmentNode } from '@/constants/segmentNode'; import { usePathname } from '@/i18n/routing'; import { Link } from '@/i18n/routing'; import { getLocationLog, getPath } from '@/utils/page'; import { refreshPage } from '@/utils/refreshPage'; -import { SegmentNode } from '@/constants/segmentNode'; interface PageTitleProps { title: string | JSX.Element; diff --git a/components/layout/pageLayout/SubNavbar.tsx b/components/layout/pageLayout/SubNavbar.tsx index daeeb7bba..f2578f485 100644 --- a/components/layout/pageLayout/SubNavbar.tsx +++ b/components/layout/pageLayout/SubNavbar.tsx @@ -2,9 +2,9 @@ import { useTranslations } from 'next-intl'; import { CurvedVerticalNode } from '@/components/common/Nodes'; import NavLabel from '@/components/layout/navbar/NavLabel'; +import { SegmentNode } from '@/constants/segmentNode'; import { Link } from '@/i18n/routing'; import { getAllSubTabs, getDepth, getPath, getRootTab } from '@/utils/page'; -import { SegmentNode } from '@/constants/segmentNode'; type TreeNode = { name: string; diff --git a/contexts/NavbarContext.tsx b/contexts/NavbarContext.tsx index 0290caa54..9e92988cd 100644 --- a/contexts/NavbarContext.tsx +++ b/contexts/NavbarContext.tsx @@ -10,12 +10,12 @@ import { useState, } from 'react'; +import { SegmentNode } from '@/constants/segmentNode'; import { usePathname } from '@/i18n/routing'; import useCurrentSegmentNode from '@/utils/hooks/useCurrentSegmentNode'; import useResponsive from '@/utils/hooks/useResponsive'; -import { SegmentNode } from '@/constants/segmentNode'; -export type NavbarState = +type NavbarState = | { type: 'closed' } | { type: 'expanded' } | { type: 'hovered'; segmentNode: SegmentNode }; diff --git a/next.config.mjs b/next.config.ts similarity index 94% rename from next.config.mjs rename to next.config.ts index 2d922c7fb..4bdaabde9 100644 --- a/next.config.mjs +++ b/next.config.ts @@ -1,7 +1,7 @@ +import { NextConfig } from 'next'; import createNextIntlPlugin from 'next-intl/plugin'; -/** @type {import('next').NextConfig} */ -const nextConfig = { +const nextConfig: NextConfig = { reactStrictMode: true, experimental: { @@ -24,6 +24,7 @@ const nextConfig = { // https://react-svgr.com/docs/next/ webpack(config) { // Grab the existing rule that handles SVG imports + // @ts-expect-error webpack 관련 설정인데 타입을 모르겠음 const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg')); config.module.rules.push( @@ -96,7 +97,7 @@ const nextConfig = { ], }, - redirects() { + async redirects() { return [ { source: '/login/success', diff --git a/package-lock.json b/package-lock.json index d14a648be..94d905d0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,13 +13,11 @@ "@mui/material": "^6.1.10", "@mui/x-date-pickers": "^7.23.1", "@svgr/webpack": "^8.1.0", - "@types/node": "20.4.0", "@types/react": "19.0.1", "@types/react-dom": "19.0.1", "autolinker": "^4.0.0", "autoprefixer": "10.4.14", "bezier-easing": "^2.1.0", - "es-toolkit": "^1.27.0", "express": "^4.19.2", "file-loader": "^6.2.0", "next": "15.0.4", @@ -32,14 +30,14 @@ "react-hot-toast": "^2.4.1", "sharp": "^0.32.5", "suneditor": "^2.46.3", - "tailwindcss": "3.3.2", - "typescript": "^5.3.3" + "tailwindcss": "3.3.2" }, "devDependencies": { "@eslint/compat": "^1.2.3", "@eslint/js": "^9.15.0", "@types/eslint": "^9.6.1", "@types/express": "^4.17.21", + "@types/node": "^22.10.1", "eslint": "^9.15.0", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.0.0", @@ -47,9 +45,11 @@ "eslint-plugin-unused-imports": "^4.1.4", "globals": "^15.12.0", "husky": "^9.1.7", + "knip": "^5.39.2", "lint-staged": "^15.2.2", "prettier": "^3.4.1", "prettier-plugin-tailwindcss": "^0.5.12", + "typescript": "^5.7.2", "typescript-eslint": "^8.16.0" } }, @@ -3121,6 +3121,24 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@snyk/github-codeowners": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz", + "integrity": "sha512-lGFf08pbkEac0NYgVf4hdANpAgApRjNByLXB+WBip3qj1iendOIyAwP2GKkKbQMNVy2r1xxDf0ssfWscoiC+Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "^4.1.1", + "ignore": "^5.1.8", + "p-map": "^4.0.0" + }, + "bin": { + "github-codeowners": "dist/cli.js" + }, + "engines": { + "node": ">=8.10" + } + }, "node_modules/@svgr/babel-plugin-add-jsx-attribute": { "version": "8.0.0", "license": "MIT", @@ -3445,8 +3463,14 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.4.0", - "license": "MIT" + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -3713,6 +3737,20 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "6.12.6", "license": "MIT", @@ -3767,6 +3805,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "dev": true, @@ -4603,7 +4651,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001585", + "version": "1.0.30001687", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz", + "integrity": "sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==", "funding": [ { "type": "opencollective", @@ -4781,6 +4831,16 @@ "node": ">=0.10.0" } }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/cli-cursor": { "version": "4.0.0", "dev": true, @@ -4816,6 +4876,17 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -5320,6 +5391,20 @@ "node": ">=0.10.0" } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -5537,6 +5622,19 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/easy-table": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", + "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "optionalDependencies": { + "wcwidth": "^1.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "license": "MIT" @@ -5585,6 +5683,20 @@ "once": "^1.4.0" } }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/entities": { "version": "4.5.0", "license": "BSD-2-Clause", @@ -5772,11 +5884,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-toolkit": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.27.0.tgz", - "integrity": "sha512-ETSFA+ZJArcuSCpzD2TjAy6UHpx4E4uqFsoDg9F/nTLogrLmVVZQ+zNxco5h7cWnA1nNak07IXsLcaSMih+ZPQ==" - }, "node_modules/escalade": { "version": "3.1.1", "license": "MIT", @@ -6902,8 +7009,7 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/graphemer": { "version": "1.4.0", @@ -7182,6 +7288,16 @@ "node": ">=0.8.19" } }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/infer-owner": { "version": "1.0.4", "license": "ISC", @@ -7816,6 +7932,92 @@ "node": ">=0.10.0" } }, + "node_modules/knip": { + "version": "5.39.2", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.39.2.tgz", + "integrity": "sha512-BuvuWRllLWV/r2G4m9ggNH+DZ6gouP/dhtJPXVlMbWNF++w9/EfrF6k2g7YBKCwjzCC+PXmYtpH8S2t8RjnY4Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/knip" + }, + { + "type": "polar", + "url": "https://polar.sh/webpro-nl" + } + ], + "license": "ISC", + "dependencies": { + "@nodelib/fs.walk": "1.2.8", + "@snyk/github-codeowners": "1.1.0", + "easy-table": "1.2.0", + "enhanced-resolve": "^5.17.1", + "fast-glob": "^3.3.2", + "jiti": "^2.4.0", + "js-yaml": "^4.1.0", + "minimist": "^1.2.8", + "picocolors": "^1.1.0", + "picomatch": "^4.0.1", + "pretty-ms": "^9.0.0", + "smol-toml": "^1.3.1", + "strip-json-comments": "5.0.1", + "summary": "2.1.0", + "zod": "^3.22.4", + "zod-validation-error": "^3.0.3" + }, + "bin": { + "knip": "bin/knip.js", + "knip-bun": "bin/knip-bun.js" + }, + "engines": { + "node": ">=18.6.0" + }, + "peerDependencies": { + "@types/node": ">=18", + "typescript": ">=5.0.4" + } + }, + "node_modules/knip/node_modules/jiti": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.1.tgz", + "integrity": "sha512-yPBThwecp1wS9DmoA4x4KR2h3QoslacnDR8ypuFM962kI4/456Iy1oHx2RAgh4jfZNdn0bctsdadceiBUgpU1g==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/knip/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/knip/node_modules/strip-json-comments": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.1.tgz", + "integrity": "sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/levn": { "version": "0.4.1", "dev": true, @@ -9110,6 +9312,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "license": "MIT", @@ -9203,6 +9421,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse-ms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "license": "MIT", @@ -9283,7 +9514,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { @@ -9667,6 +9900,22 @@ } } }, + "node_modules/pretty-ms": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", + "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-ms": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/process": { "version": "0.11.10", "license": "MIT", @@ -10603,6 +10852,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/smol-toml": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.1.tgz", + "integrity": "sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/snake-case": { "version": "3.0.4", "license": "MIT", @@ -11302,6 +11564,13 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/summary": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/summary/-/summary-2.1.0.tgz", + "integrity": "sha512-nMIjMrd5Z2nuB2RZCKJfFMjgS3fygbeyGk9PxPPaJR1RIcyN9yn4A63Isovzm3ZtQuEkLBVgMdPup8UeLH7aQw==", + "dev": true, + "license": "MIT" + }, "node_modules/suneditor": { "version": "2.46.3", "license": "MIT" @@ -11396,6 +11665,16 @@ "node": ">=14.0.0" } }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/tar-fs": { "version": "3.0.4", "license": "MIT", @@ -11770,7 +12049,10 @@ "peer": true }, "node_modules/typescript": { - "version": "5.3.3", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -12057,6 +12339,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "license": "MIT", @@ -12597,6 +12886,17 @@ "node": ">=0.10.0" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/webpack": { "version": "4.47.0", "license": "MIT", @@ -13107,6 +13407,29 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.4.0.tgz", + "integrity": "sha512-ZOPR9SVY6Pb2qqO5XHt+MkkTRxGXb4EVtnjc9JpXUOtUB1T9Ru7mZOT361AN3MsetVe7R0a1KZshJDZdgp9miQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.18.0" + } } } } diff --git a/package.json b/package.json index 2ae1d1cb0..5e7e38c34 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build:prod": "PHASE=prod next build", "start:prod": "PHASE=prod NODE_ENV=production node server.mjs", "prepare": "husky", - "postbuild": "next-sitemap" + "postbuild": "next-sitemap", + "knip": "knip" }, "dependencies": { "@emotion/react": "^11.11.1", @@ -19,13 +20,11 @@ "@mui/material": "^6.1.10", "@mui/x-date-pickers": "^7.23.1", "@svgr/webpack": "^8.1.0", - "@types/node": "20.4.0", "@types/react": "19.0.1", "@types/react-dom": "19.0.1", "autolinker": "^4.0.0", "autoprefixer": "10.4.14", "bezier-easing": "^2.1.0", - "es-toolkit": "^1.27.0", "express": "^4.19.2", "file-loader": "^6.2.0", "next": "15.0.4", @@ -38,14 +37,14 @@ "react-hot-toast": "^2.4.1", "sharp": "^0.32.5", "suneditor": "^2.46.3", - "tailwindcss": "3.3.2", - "typescript": "^5.3.3" + "tailwindcss": "3.3.2" }, "devDependencies": { "@eslint/compat": "^1.2.3", "@eslint/js": "^9.15.0", "@types/eslint": "^9.6.1", "@types/express": "^4.17.21", + "@types/node": "^22.10.1", "eslint": "^9.15.0", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.0.0", @@ -53,9 +52,11 @@ "eslint-plugin-unused-imports": "^4.1.4", "globals": "^15.12.0", "husky": "^9.1.7", + "knip": "^5.39.2", "lint-staged": "^15.2.2", "prettier": "^3.4.1", "prettier-plugin-tailwindcss": "^0.5.12", + "typescript": "^5.7.2", "typescript-eslint": "^8.16.0" }, "overrides": { diff --git a/types/form.ts b/types/form.ts index 0c06eb40b..2114c61d3 100644 --- a/types/form.ts +++ b/types/form.ts @@ -6,3 +6,43 @@ export type Rules = 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled' > | undefined; + +export type EditorFile = LocalFile | UploadedFile; + +export interface LocalFile { + type: 'LOCAL_FILE'; + file: File; +} + +interface UploadedFile { + type: 'UPLOADED_FILE'; + file: { + id: number; + name: string; + url: string; + bytes: number; + }; +} + +export const isLocalFile = (file: EditorFile): file is LocalFile => file.type === 'LOCAL_FILE'; + +export const isUploadedFile = (file: EditorFile): file is UploadedFile => + file.type === 'UPLOADED_FILE'; + +export type EditorImage = LocalImage | UploadedImage | null; + +export interface LocalImage { + type: 'LOCAL_IMAGE'; + file: File; +} + +export interface UploadedImage { + type: 'UPLOADED_IMAGE'; + url: string; +} + +export const isLocalImage = (image: LocalImage | UploadedImage): image is LocalImage => + image.type === 'LOCAL_IMAGE'; + +export const isUploadedImage = (image: LocalImage | UploadedImage): image is LocalImage => + image.type === 'UPLOADED_IMAGE'; diff --git a/types/seminar.ts b/types/seminar.ts deleted file mode 100644 index cbbf4af7d..000000000 --- a/types/seminar.ts +++ /dev/null @@ -1,96 +0,0 @@ -export interface SeminarPreviewList { - total: number; - searchList: SeminarPreview[]; -} - -export interface SeminarPreview { - id: number; - title: string; - description: string; - name: string; - affiliation: string; - startDate: string; - location: string; - imageURL: string | null; - isYearLast: boolean; -} - -export interface Seminar { - affiliation: string | null; - affiliationURL: string | null; - attachments: { - id: number; - name: string; - url: string; - bytes: number; - }[]; - createdAt: string; - description: string | null; - endDate: string | null; - host: string | null; - id: number; - imageURL: string | null; - introduction: string | null; - isImportant: boolean; - isPrivate: boolean; - location: string; - modifiedAt: string; - name: string | null; - nextId: number | null; - nextTitle: string | null; - prevId: number | null; - prevTitle: string | null; - speakerTitle: string | null; - speakerURL: string | null; - startDate: string; - title: string; - titleForMain: string; -} - -export interface POSTSeminarBody { - request: { - title: string | null; - titleForMain: string | null; - description: string | null; - introduction: string | null; - name: string | null; - speakerURL: string | null; - speakerTitle: string | null; - affiliation: string | null; - affiliationURL: string | null; - startDate: string; - endDate: string | null; - location: string; - host: string | null; - isPrivate: boolean; - isImportant: boolean; - }; - - image: File | null; - attachments: File[]; -} - -export interface PATCHSeminarBody { - request: { - title: string | null; - titleForMain: string | null; - description: string | null; - introduction: string | null; - name: string | null; - speakerURL: string | null; - speakerTitle: string | null; - affiliation: string | null; - affiliationURL: string | null; - startDate: string; - endDate: string | null; - location: string; - host: string | null; - isPrivate: boolean; - isImportant: boolean; - - deleteIds: number[]; - }; - - newAttachments: File[]; - image: File | null; -} diff --git a/utils/formData.ts b/utils/formData.ts index 90b9c7d1b..c7afcba2f 100644 --- a/utils/formData.ts +++ b/utils/formData.ts @@ -1,11 +1,5 @@ import { Attachment } from '@/components/common/Attachments'; -import { - EditorFile, - EditorImage, - isLocalFile, - isLocalImage, - isUploadedFile, -} from '@/components/form/types'; +import { EditorFile, EditorImage, isLocalFile, isLocalImage, isUploadedFile } from '@/types/form'; import { encodeFormDataFileName } from './string'; diff --git a/utils/hooks/useCurrentSegmentNode.ts b/utils/hooks/useCurrentSegmentNode.ts index 2739d1898..b8493f83f 100644 --- a/utils/hooks/useCurrentSegmentNode.ts +++ b/utils/hooks/useCurrentSegmentNode.ts @@ -1,5 +1,5 @@ -import { usePathname } from '@/i18n/routing'; import { admin, main, SegmentNode, tentenProject } from '@/constants/segmentNode'; +import { usePathname } from '@/i18n/routing'; export default function useCurrentSegmentNode(): SegmentNode { const pathname = usePathname(); diff --git a/utils/hooks/useCustomSearchParams.ts b/utils/hooks/useCustomSearchParams.ts index fef7cfc93..41956c7fc 100644 --- a/utils/hooks/useCustomSearchParams.ts +++ b/utils/hooks/useCustomSearchParams.ts @@ -1,10 +1,10 @@ import { useSearchParams } from 'next/navigation'; +import { PostSearchQueryParams } from '@/apis/types/post'; import { usePathname, useRouter } from '@/i18n/routing'; -import { PostSearchQueryParams } from '@/types/post'; import { objToQueryString, urlSearchParamsToString } from '@/utils/convertParams'; -export type SearchInfo = +type SearchInfo = | { purpose: 'search'; keyword: string; tag?: string[] } | { purpose: 'navigation'; pageNum: number }; diff --git a/utils/hooks/useHorizontalScroll.ts b/utils/hooks/useHorizontalScroll.ts deleted file mode 100644 index af157f824..000000000 --- a/utils/hooks/useHorizontalScroll.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { useEffect, useRef } from 'react'; - -export default function useHorizontalScroll() { - const scrollRef = useRef(null); - - useEffect(() => { - const scrollDiv = scrollRef.current; - - if (scrollDiv) { - const onWheel = (e: WheelEvent) => { - // https://stackoverflow.com/a/74597327 - const isMouse = e.deltaY && !Number.isInteger(e.deltaY); - if (!isMouse) return; - e.preventDefault(); // prevent vertical scrolling while scrolling horizontally - scrollDiv.scrollTo({ - left: scrollDiv.scrollLeft + e.deltaY * 2, - behavior: 'smooth', - }); - }; - - scrollDiv.addEventListener('wheel', onWheel); - - return () => scrollDiv.removeEventListener('wheel', onWheel); - } - }, []); - - return { scrollRef }; -} diff --git a/utils/type.ts b/utils/type.ts deleted file mode 100644 index 5f2cf2cf0..000000000 --- a/utils/type.ts +++ /dev/null @@ -1 +0,0 @@ -export type ValueOf = T[keyof T];