From 1fa1d316969de15d6aaef1dbf0a0b95aec30e377 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 16 Oct 2023 10:45:22 +0900 Subject: perf(backend): createdAtをidから取得するように & 無駄なDateインスタンスの生成を避けるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/ClipService.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/backend/src/core/ClipService.ts') diff --git a/packages/backend/src/core/ClipService.ts b/packages/backend/src/core/ClipService.ts index 3d9982e80f..e94f1eb531 100644 --- a/packages/backend/src/core/ClipService.ts +++ b/packages/backend/src/core/ClipService.ts @@ -46,8 +46,7 @@ export class ClipService { } const clip = await this.clipsRepository.insert({ - id: this.idService.genId(), - createdAt: new Date(), + id: this.idService.gen(), userId: me.id, name: name, isPublic: isPublic, @@ -109,7 +108,7 @@ export class ClipService { try { await this.clipNotesRepository.insert({ - id: this.idService.genId(), + id: this.idService.gen(), noteId: noteId, clipId: clip.id, }); -- cgit v1.2.3-freya