Skip to content

Commit

Permalink
Style: 함수 명 변경
Browse files Browse the repository at this point in the history
Style: 함수 명 변경
  • Loading branch information
JJieunn authored Oct 25, 2022
2 parents 2bb68b5 + ea6e556 commit 4defe40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/models/postsDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Users } from "../entities/user.entity";
import { NotFoundError, ForbiddenError } from "../middlewares/createError"


const isPostExistByPostId = async (postId: string): Promise<object | undefined> => {
const isPostExistedByPostId = async (postId: string): Promise<object | undefined> => {
const postRes = await myDataSource
.createQueryBuilder()
.select("COUNT(id)", "count")
Expand All @@ -19,7 +19,7 @@ const isPostExistByPostId = async (postId: string): Promise<object | undefined>
}


const isPostExistByUserId = async (userId: string | string[] | undefined, postId: string): Promise<object | undefined> => {
const isPostExistedByUserId = async (userId: string | string[] | undefined, postId: string): Promise<object | undefined> => {
const userPostRes = await myDataSource
.createQueryBuilder()
.select("COUNT(id)", "count")
Expand Down Expand Up @@ -92,8 +92,8 @@ const deletePost = async (postId: string): Promise<void> => {


export default {
isPostExistByPostId,
isPostExistByUserId,
isPostExistedByPostId,
isPostExistedByUserId,
createPost,
getPostList,
getPost,
Expand Down
10 changes: 5 additions & 5 deletions src/services/postsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ const getPostList = async () => {
}

const getPost = async (postId: string) => {
await postDao.isPostExistByPostId(postId)
await postDao.isPostExistedByPostId(postId)
return await postDao.getPost(postId)
}

const updatePost = async (userId: string | string[] | undefined, postId: string, updateData: UpdaatePostDTO) => {
await postDao.isPostExistByPostId(postId)
await postDao.isPostExistByUserId(userId, postId)
await postDao.isPostExistedByPostId(postId)
await postDao.isPostExistedByUserId(userId, postId)
return await postDao.updatePost(postId, updateData)
}

const deletePost = async (userId: string | string[] | undefined, postId: string) => {
await postDao.isPostExistByPostId(postId)
await postDao.isPostExistByUserId(userId, postId)
await postDao.isPostExistedByPostId(postId)
await postDao.isPostExistedByUserId(userId, postId)
await postDao.deletePost(postId)
}

Expand Down

0 comments on commit 4defe40

Please sign in to comment.