From 6969c0445c5bc3b3ef055f5753597db1d355e979 Mon Sep 17 00:00:00 2001 From: kim jong hwa Date: Mon, 6 Nov 2023 16:25:00 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=BA=90=EC=8B=B1=20=EB=A1=A4=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/searches/searches.service.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/searches/searches.service.ts b/src/searches/searches.service.ts index a60d4ec..512e18f 100644 --- a/src/searches/searches.service.ts +++ b/src/searches/searches.service.ts @@ -1,23 +1,15 @@ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { PrismaService } from '../prisma/prisma.service'; import { SearchesDto } from './searches.dto/searches.dto'; -import { CACHE_MANAGER } from '@nestjs/cache-manager'; -import { Cache } from 'cache-manager'; @Injectable() export class SearchesService { constructor( - @Inject(CACHE_MANAGER) private readonly cacheManager: Cache, private readonly prisma: PrismaService ) {} async search(searchesDto: SearchesDto) { - const searchedEvents: any = await this.cacheManager.get('searchedEvents'); - const cachedData = searchedEvents ? searchedEvents : null; - if (cachedData) { - return cachedData; - } else { - const events = await this.prisma.event.findMany({ + return await this.prisma.event.findMany({ where: { isDeleted: false, AND: [ @@ -64,8 +56,5 @@ export class SearchesService { createdAt: 'desc', }, }); - await this.cacheManager.set('searchedEvents', events); - return events; } } -}