Skip to content
Merged
12 changes: 10 additions & 2 deletions .github/workflows/test-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [20, 21, 22, 23]
fail-fast: false # ν•œ 버전 μ‹€νŒ¨ μ‹œ 전체 쀑단 λ°©μ§€
fail-fast: false # ν•œ 버전 μ‹€νŒ¨ μ‹œ 전체 쀑단 λ°©μ§€

steps:
- name: Checkout repository
Expand Down Expand Up @@ -50,11 +50,19 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create .env file
run: |
echo "DATABASE_NAME=${{ secrets.DATABASE_NAME }}" >> .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env

- name: Run lint
run: pnpm run lint

- name: Run tests
run: pnpm run test

- name: Run build
run: pnpm run build
run: pnpm run build
6 changes: 3 additions & 3 deletions src/controllers/post.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
export class PostController {
constructor(private postService: PostService) {}

getAllPost: RequestHandler = async (
getAllPosts: RequestHandler = async (
req: Request<object, object, object, GetAllPostsQuery>,
res: Response<PostsResponseDto>,
next: NextFunction,
Expand All @@ -38,15 +38,15 @@ export class PostController {
}
};

getAllPostStatistics: RequestHandler = async (
getAllPostsStatistics: RequestHandler = async (
req: Request,
res: Response<PostStatisticsResponseDto>,
next: NextFunction,
) => {
try {
const { id } = req.user;

const stats = await this.postService.getAllPostStatistics(id);
const stats = await this.postService.getAllPostsStatistics(id);
const totalPostCount = await this.postService.getTotalPostCounts(id);

const response = new PostStatisticsResponseDto(
Expand Down
Loading