-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* newsAction 추가 * noticeAction 관련 리팩토링 * newsAction 추가 * validateNoticeForm 추가 * noticeActions 추가 * autolinker 추가 * 예약 모달 보더 추가 * seminarAction 추가 * 편집 취소시 모달 추가 * 편집중 취소, 삭제 모달 추가 * 사소한 수정 * 소식 검색 결과 개수 반영
- Loading branch information
Showing
34 changed files
with
262 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ jobs: | |
script: | | ||
cd ~/csereal-web | ||
git pull | ||
npm i | ||
npm run build | ||
pm2 restart csereal_front |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use server'; | ||
|
||
import { revalidateTag } from 'next/cache'; | ||
import { redirect } from 'next/navigation'; | ||
|
||
import { deleteNews } from '@/apis/newsServer'; | ||
|
||
import { news } from '@/types/page'; | ||
|
||
import { getPath } from '@/utils/page'; | ||
|
||
const newsPath = getPath(news); | ||
|
||
export const newsDeleteAction = async (id: number) => { | ||
try { | ||
await deleteNews(id); | ||
revalidateNewsTag(); | ||
} catch (error) { | ||
return { message: error instanceof Error ? error.message : '알 수 없는 에러: ' + error }; | ||
} | ||
redirect(newsPath); | ||
}; | ||
|
||
export const revalidateNewsTag = () => { | ||
revalidateTag('news'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use server'; | ||
|
||
import { revalidateTag } from 'next/cache'; | ||
import { redirect } from 'next/navigation'; | ||
|
||
import { deleteSeminar } from '@/apis/seminarServer'; | ||
|
||
import { seminar } from '@/types/page'; | ||
|
||
import { getPath } from '@/utils/page'; | ||
|
||
const seminarPath = getPath(seminar); | ||
|
||
export const seminarDeleteAction = async (id: number) => { | ||
try { | ||
await deleteSeminar(id); | ||
revalidateSeminarTag(); | ||
} catch (error) { | ||
return { message: error instanceof Error ? error.message : '알 수 없는 에러: ' + error }; | ||
} | ||
redirect(seminarPath); | ||
}; | ||
|
||
export const revalidateSeminarTag = () => { | ||
revalidateTag('seminar'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { News, NewsPreviewList } from '@/types/news'; | ||
import { PostSearchQueryParams } from '@/types/post'; | ||
|
||
import { deleteRequest, getRequest } from './serverIndex'; | ||
|
||
const newsPath = '/news'; | ||
|
||
export const getNewsPosts = (params: PostSearchQueryParams) => | ||
getRequest(newsPath, params, { next: { tags: ['news'] } }) as Promise<NewsPreviewList>; | ||
|
||
export const getNewsPostDetail = (id: number, params?: PostSearchQueryParams) => | ||
getRequest(`${newsPath}/${id}`, params, { next: { tags: ['news'] } }) as Promise<News>; | ||
|
||
export const deleteNews = (id: number) => deleteRequest(`${newsPath}/${id}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { PostSearchQueryParams } from '@/types/post'; | ||
import { SeminarList, Seminar } from '@/types/seminar'; | ||
|
||
import { deleteRequest, getRequest } from './serverIndex'; | ||
|
||
const seminarPath = '/seminar'; | ||
|
||
export const getSeminarPosts = async (params: PostSearchQueryParams) => { | ||
return (await getRequest(seminarPath, params, { next: { tags: ['seminar'] } })) as SeminarList; | ||
}; | ||
|
||
export const getSeminarPost = async (id: number, params: PostSearchQueryParams) => { | ||
return (await getRequest(`${seminarPath}/${id}`, params, { | ||
next: { tags: ['seminar'] }, | ||
})) as Seminar; | ||
}; | ||
|
||
export const deleteSeminar = async (id: number) => deleteRequest(`${seminarPath}/${id}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.