From 5f9e69fabbdf5fb20a2027f9e9fbb38ff55f1ef2 Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 30 Jan 2024 18:35:18 +0800 Subject: [PATCH] fix: Remove unused code and update create method in PostController Signed-off-by: Innei --- apps/core/src/modules/post/post.controller.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/core/src/modules/post/post.controller.ts b/apps/core/src/modules/post/post.controller.ts index 49ad3751..342d18fe 100644 --- a/apps/core/src/modules/post/post.controller.ts +++ b/apps/core/src/modules/post/post.controller.ts @@ -22,7 +22,6 @@ import { CountingService } from '~/processors/helper/helper.counting.service' import { MongoIdDto } from '~/shared/dto/id.dto' import { PagerDto } from '~/shared/dto/pager.dto' import { addYearCondition } from '~/transformers/db-query.transformer' -import { getLessThanNow } from '~/utils' import { CategoryAndSlugDto } from './post.dto' import { PartialPostModel, PostModel } from './post.model' @@ -198,9 +197,7 @@ export class PostController { @Auth() @HTTPDecorators.Idempotence() async create(@Body() body: PostModel) { - body.created = getLessThanNow(body.created) return await this.postService.create({ - created: new Date(), ...body, modified: null, slug: body.slug,