From 86683a5bf33bd7845c1cac435f6e59cf83cba099 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:28:42 +0100 Subject: [PATCH 1/2] Bugfix/fix AI prompt endpoint (#4185) --- apps/api/src/app/endpoints/ai/ai.controller.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/apps/api/src/app/endpoints/ai/ai.controller.ts b/apps/api/src/app/endpoints/ai/ai.controller.ts index c4c4b375d..981b26aa2 100644 --- a/apps/api/src/app/endpoints/ai/ai.controller.ts +++ b/apps/api/src/app/endpoints/ai/ai.controller.ts @@ -1,16 +1,14 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; -import { ImpersonationService } from '@ghostfolio/api/services/impersonation/impersonation.service'; import { DEFAULT_CURRENCY, - DEFAULT_LANGUAGE_CODE, - HEADER_KEY_IMPERSONATION + DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; import { AiPromptResponse } from '@ghostfolio/common/interfaces'; import { permissions } from '@ghostfolio/common/permissions'; import type { RequestWithUser } from '@ghostfolio/common/types'; -import { Controller, Get, Headers, Inject, UseGuards } from '@nestjs/common'; +import { Controller, Get, Inject, UseGuards } from '@nestjs/common'; import { REQUEST } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; @@ -20,21 +18,15 @@ import { AiService } from './ai.service'; export class AiController { public constructor( private readonly aiService: AiService, - private readonly impersonationService: ImpersonationService, @Inject(REQUEST) private readonly request: RequestWithUser ) {} @Get('prompt') @HasPermission(permissions.readAiPrompt) @UseGuards(AuthGuard('jwt'), HasPermissionGuard) - public async getPrompt( - @Headers(HEADER_KEY_IMPERSONATION.toLowerCase()) impersonationId - ): Promise { - const impersonationUserId = - await this.impersonationService.validateImpersonationId(impersonationId); - + public async getPrompt(): Promise { const prompt = await this.aiService.getPrompt({ - impersonationId: impersonationUserId, + impersonationId: undefined, languageCode: this.request.user.Settings.settings.language ?? DEFAULT_LANGUAGE_CODE, userCurrency: From ce85a14b110fa5a553ff351c8c61c5fdb45c35bc Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:30:21 +0100 Subject: [PATCH 2/2] Release 2.133.1 (#4186) --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d6b69c38..58f0c037a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 2.133.0 - 2025-01-08 +## 2.133.1 - 2025-01-09 ### Added diff --git a/package-lock.json b/package-lock.json index d13cb30bc..d5ac0bab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.133.0", + "version": "2.133.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.133.0", + "version": "2.133.1", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/package.json b/package.json index f74b327cc..447d309a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.133.0", + "version": "2.133.1", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio",