Skip to content

Commit

Permalink
perf(page-service): tag searching return data with all fields (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee authored Jan 24, 2023
1 parent ec0325a commit 4b4171d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions apps/page-service/src/category.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import { HttpStatus, Inject, Injectable } from '@nestjs/common';
import { RpcException } from '@nestjs/microservices';
import { ReturnModelType, DocumentType } from '@typegoose/typegoose';
import { omit } from 'lodash';
import { FilterQuery } from 'mongoose';
import { nextTick } from 'process';
import { InjectModel } from '~/libs/database/src/model.transformer';
Expand Down Expand Up @@ -163,13 +162,7 @@ export class CategoryService {
message: ExceptionMessage.PageIsNotExist,
});

return posts.map(({ _id, title, slug, category, created }) => ({
_id,
title,
slug,
category: omit(category, ['count', '__v', 'created', 'modified']),
created,
}));
return posts;
}

/**
Expand Down

0 comments on commit 4b4171d

Please sign in to comment.