Skip to content

Commit

Permalink
Merge pull request #158 from modern-agile-team/feature/search
Browse files Browse the repository at this point in the history
modify(#143): use interceptors in search controller
  • Loading branch information
hobiJeong authored Dec 21, 2023
2 parents 87277f3 + 1a37094 commit 6933ad7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/search/controllers/search.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Param,
ParseIntPipe,
Query,
UseInterceptors,
UsePipes,
ValidationPipe,
} from '@nestjs/common';
Expand All @@ -13,8 +14,10 @@ import { ApiTags } from '@nestjs/swagger';
import { ApiSearchBoardsByBody } from '../swagger-decorators/search-boards-by-body.decorator';
import { ApiSearchBoardsByHead } from '../swagger-decorators/search-boards-by-head.decorator';
import { ApiSearchBoardsByUserName } from '../swagger-decorators/search-boards-by-user-name.decorator';
import { SuccessResponseInterceptor } from 'src/common/interceptors/success-response.interceptor';

@ApiTags('SEARCH')
@UseInterceptors(SuccessResponseInterceptor)
@UsePipes(ValidationPipe)
@Controller('search')
export class SearchController {
Expand Down
12 changes: 6 additions & 6 deletions src/search/services/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down Expand Up @@ -106,7 +106,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down Expand Up @@ -164,7 +164,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down Expand Up @@ -222,7 +222,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down Expand Up @@ -279,7 +279,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down Expand Up @@ -340,7 +340,7 @@ export class SearchService {
);
if (last_page >= page) {
return {
data: boardResponse,
boardResponse,
meta: {
total,
page: page <= 0 ? (page = 1) : page,
Expand Down

0 comments on commit 6933ad7

Please sign in to comment.