-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: 자료집 UI 구현 #379
Feat: 자료집 UI 구현 #379
Changes from all commits
64e549b
be50fa1
7e4c6fc
56ac8b4
10c51d6
70f9d5c
1b1d262
5aff7ab
92575bb
87ca081
40a8d83
7f800f7
d62ec1c
8a9edc1
90ff36c
ba4bc06
2077c7b
6bf49c9
3c0e93f
97daf0c
6659fe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,8 @@ jobs: | |
username: ubuntu | ||
host: ${{ secrets.SSH_HOST }} | ||
key: ${{ secrets.SSH_KEY }} | ||
source: "dist.tar" | ||
target: "/home/ubuntu/" | ||
source: 'dist.tar' | ||
target: '/home/ubuntu/' | ||
- name: Extract artifact with SSH | ||
uses: appleboy/[email protected] | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,8 @@ jobs: | |
username: ubuntu | ||
host: ${{ secrets.SSH_HOST }} | ||
key: ${{ secrets.SSH_KEY }} | ||
source: "dist.tar" | ||
target: "/home/ubuntu/" | ||
source: 'dist.tar' | ||
target: '/home/ubuntu/' | ||
- name: Extract artifact with SSH | ||
uses: appleboy/[email protected] | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"trailingComma": "es5", | ||
"printWidth": 120, | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
"components": "@/components", | ||
"utils": "@/libs/utils" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
import { clientAuth } from './client'; | ||
import { AxiosResponse } from 'axios'; | ||
// import { clientAuth } from './client'; | ||
// import { AxiosResponse } from 'axios'; | ||
|
||
// Reuse the Filters interface | ||
interface Filters { | ||
[key: string]: any; | ||
} | ||
// // Reuse the Filters interface | ||
// interface Filters { | ||
// [key: string]: any; | ||
// } | ||
|
||
// Request parameters interface | ||
interface GetBoardDataPostsParams { | ||
filters?: Filters; | ||
page: number; | ||
} | ||
// // Request parameters interface | ||
// interface GetBoardDataPostsParams { | ||
// filters?: Filters; | ||
// page: number; | ||
// } | ||
|
||
// Define the structure of a single file | ||
interface PostFile { | ||
postFileId: number; | ||
fileName: string; | ||
fileUrl: string; | ||
fileType: string; | ||
} | ||
// // Define the structure of a single file | ||
// interface PostFile { | ||
// postFileId: number; | ||
// fileName: string; | ||
// fileUrl: string; | ||
// fileType: string; | ||
// } | ||
|
||
// Define the structure of a single post | ||
interface PostListResDto { | ||
postId: number; | ||
category: string; | ||
date: string; | ||
title: string; | ||
files: PostFile[]; | ||
isNotice: boolean; | ||
// Add other relevant fields as needed | ||
} | ||
// // Define the structure of a single post | ||
// interface PostListResDto { | ||
// postId: number; | ||
// category: string; | ||
// date: string; | ||
// title: string; | ||
// files: PostFile[]; | ||
// isNotice: boolean; | ||
// // Add other relevant fields as needed | ||
// } | ||
|
||
// Define the pagination information | ||
interface PageInfo { | ||
totalElements: number; | ||
totalPages: number; | ||
currentPage: number; | ||
// Add other relevant fields if necessary | ||
} | ||
// // Define the pagination information | ||
// interface PageInfo { | ||
// totalElements: number; | ||
// totalPages: number; | ||
// currentPage: number; | ||
// // Add other relevant fields if necessary | ||
// } | ||
|
||
// Define the structure of the API response | ||
interface GetBoardDataPostsResponse { | ||
data: { | ||
postListResDto: PostListResDto[]; | ||
pageInfo: PageInfo; | ||
}; | ||
} | ||
// // Define the structure of the API response | ||
// interface GetBoardDataPostsResponse { | ||
// data: { | ||
// postListResDto: PostListResDto[]; | ||
// pageInfo: PageInfo; | ||
// }; | ||
// } | ||
|
||
// Update the function to return the correct response type | ||
export const getBoardDataPosts = async ({ | ||
filters = {}, | ||
page, | ||
}: GetBoardDataPostsParams): Promise<GetBoardDataPostsResponse> => { | ||
const response: AxiosResponse<GetBoardDataPostsResponse> = await clientAuth({ | ||
url: `/board/data/posts`, | ||
method: 'get', | ||
params: { | ||
take: 5, | ||
page: page - 1, // Assuming your API uses 0-based pagination | ||
...filters, | ||
}, | ||
}); | ||
return response.data; | ||
}; | ||
// // Update the function to return the correct response type | ||
// export const getBoardDataPosts = async ({ | ||
// filters = {}, | ||
// page, | ||
// }: GetBoardDataPostsParams): Promise<GetBoardDataPostsResponse> => { | ||
// const response: AxiosResponse<GetBoardDataPostsResponse> = await clientAuth({ | ||
// url: `/board/data/posts`, | ||
// method: 'get', | ||
// params: { | ||
// take: 5, | ||
// page: page - 1, // Assuming your API uses 0-based pagination | ||
// ...filters, | ||
// }, | ||
// }); | ||
// return response.data; | ||
// }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { client } from '@/apis/client'; | ||
// import { client } from '@/apis/client'; | ||
|
||
export const postBoardDataSubCategoryPosts = ( | ||
fileCategory: string, | ||
resBody: { | ||
title: string | null; | ||
content: string; | ||
categoryCode: string; | ||
thumbNailImage: null; | ||
isNotice: boolean; | ||
postFileList: any[]; | ||
}, | ||
accessToken: string | ||
) => { | ||
return client.post(`/board/data/${fileCategory}/post`, resBody, { | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
}, | ||
}); | ||
}; | ||
// export const postBoardDataSubCategoryPosts = ( | ||
// fileCategory: string, | ||
// resBody: { | ||
// title: string | null; | ||
// content: string; | ||
// categoryCode: string; | ||
// thumbNailImage: null; | ||
// isNotice: boolean; | ||
// postFileList: any[]; | ||
// }, | ||
// accessToken: string | ||
// ) => { | ||
// return client.post(`/board/data/${fileCategory}/post`, resBody, { | ||
// headers: { | ||
// Authorization: `Bearer ${accessToken}`, | ||
// }, | ||
// }); | ||
// }; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,7 +13,7 @@ export async function postBoardFiles({ | |||||
boardCode, | ||||||
files = [], | ||||||
images = [], | ||||||
}: postBoardFilesProps): Promise<AxiosResponse<any>> { | ||||||
}: postBoardFilesProps): Promise<AxiosResponse> { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이건 백엔드의 리턴 타입대로 구현하는게 맞을 것 같네요.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 다만 |
||||||
const formData = new FormData(); | ||||||
|
||||||
files.forEach((file) => { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ export interface postBoardPostsProps { | |
content: string; | ||
categoryCode?: string; | ||
groupCode?: string; | ||
memberCode?: string; | ||
memberCode?: string | null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어떤 경우에 만약 이게 |
||
thumbNailImage?: string | null; | ||
isNotice?: boolean; | ||
postFileList?: number[] | null; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 코드는 전체 주석처리해도 문제 없나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일 제외하고도 사용하지 않는 api 훅들이 많아 보이는데 다 삭제하죠.
getBoardDataPosts.ts
getBoardDataPostSearch.ts
getOnboardingEmail.ts
patchBoardDataPosts.ts
postBoardBoardCodeFiles.ts
postBoardDataFiles.ts
postBoardDataSubCategoryPost.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자료집 API인데, Lint 오류 때문에 주석 처리했어요. 제가 다시 구현해야 해서 일단 급하게 땜질했습니다