📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
remove data retrieval by timeframe
Yehor Dremliuhac063040ebd1a
diff --git a/apps/production/src/project/dto/get-prediction-query.dto.ts b/apps/production/src/project/dto/get-prediction-query.dto.tsdeleted file mode 100644index ee7731490..000000000--- a/apps/production/src/project/dto/get-prediction-query.dto.ts+++ /dev/null@@ -1,24 +0,0 @@-import { ApiProperty } from '@nestjs/swagger'-import { IsEnum, IsNotEmpty } from 'class-validator'--export enum TimeFrameQueryEnum {- NEXT_1_HOUR = 'next_1_hour',- NEXT_4_HOUR = 'next_4_hour',- NEXT_8_HOUR = 'next_8_hour',- NEXT_12_HOUR = 'next_12_hour',- NEXT_24_HOUR = 'next_24_hour',- NEXT_72_HOUR = 'next_72_hour',- NEXT_168_HOUR = 'next_168_hour',-}--export class TimeFrameQueryEnumDTO {- @ApiProperty({- example: 'next_8_hour',- required: true,- description: 'The timeframe of prediction',- enum: TimeFrameQueryEnum,- })- @IsNotEmpty()- @IsEnum(TimeFrameQueryEnum)- timeframe: TimeFrameQueryEnum-}diff --git a/apps/production/src/project/project.controller.ts b/apps/production/src/project/project.controller.tsindex 7500a0a1c..411d8d41c 100644--- a/apps/production/src/project/project.controller.ts+++ b/apps/production/src/project/project.controller.ts@@ -107,7 +107,6 @@ import { ProjectIdDto } from './dto/project-id.dto'import { CreateProjectViewDto } from './dto/create-project-view.dto'import { UpdateProjectViewDto } from './dto/update-project-view.dto'import { ProjectViewIdsDto } from './dto/project-view-ids.dto'-import { TimeFrameQueryEnumDTO } from './dto/get-prediction-query.dto'const PROJECTS_MAXIMUM = 50@@ -2128,7 +2127,6 @@ export class ProjectController {@Auth([], true, true)async getAiPrediction(@Param() params: ProjectIdDto,- @Query() query: TimeFrameQueryEnumDTO,@CurrentUserId() userId: string,@Headers() headers: { 'x-password'?: string },) {@@ -2146,7 +2144,6 @@ export class ProjectController {return this.projectService.sendPredictAiRequest(params.projectId,- query.timeframe,)}}diff --git a/apps/production/src/project/project.service.ts b/apps/production/src/project/project.service.tsindex 7442a2eb1..d6d32ff36 100644--- a/apps/production/src/project/project.service.ts+++ b/apps/production/src/project/project.service.ts@@ -72,7 +72,6 @@ import {import { ReportFrequency } from './enums'import { nFormatter } from '../common/utils'import { browserArgs } from '../og-image/og-image.service'-import { TimeFrameQueryEnum } from './dto/get-prediction-query.dto'import { AppLoggerService } from '../logger/logger.service'dayjs.extend(utc)@@ -1354,11 +1353,11 @@ export class ProjectService {return this.projectsRepository.findOne({ relations, where: { id } })}- async sendPredictAiRequest(id: string, timeframe: TimeFrameQueryEnum) {+ async sendPredictAiRequest(id: string) {try {const { data } = await firstValueFrom(this.httpService.get('/predict/', {- params: { pid: id, timeframe },+ params: { pid: id },}),)return data