Skip to content

Commit

Permalink
modify/#66: modify error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hobiJeong committed Dec 8, 2023
1 parent d903eaa commit 0820ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/apis/free-posts/controllers/free-posts.swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { PaginationResponseDto } from '@src/interceptors/success-interceptor/dto
import { ApiOperator } from '@src/types/type';
import { ValidationError } from '@src/types/validation-errors.type';

/**
* @todo
*/
export const ApiFreePost: ApiOperator<keyof FreePostsController> = {
Create: (
apiOperationOptions: Required<Pick<Partial<OperationObject>, 'summary'>> &
Expand Down
2 changes: 1 addition & 1 deletion src/apis/notice-posts/services/notice-posts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class NoticePostsService {
userId: number,
patchUpdateNoticePostDto: PatchUpdateNoticePostDto,
) {
if (!patchUpdateNoticePostDto) {
if (!Object.values(patchUpdateNoticePostDto).length) {
throw new HttpBadRequestException({
code: COMMON_ERROR_CODE.MISSING_UPDATE_FIELD,
errors: ['update filed is null'],
Expand Down

0 comments on commit 0820ade

Please sign in to comment.