main
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-05-11 08:00:02 +02:00
parent 2e6c272eee
commit 76a244af90
2 changed files with 24 additions and 1 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { Controller, Get, Post, Body, Res, HttpStatus, Param } from '@nestjs/common'; import { Controller, Get, Post, Body, Res, HttpStatus, Param, Delete } from '@nestjs/common';
import { Public } from '../../common/decorators'; import { Public } from '../../common/decorators';
import { VoiceboxService } from './voicebox.service'; import { VoiceboxService } from './voicebox.service';
import type { Response } from 'express'; import type { Response } from 'express';
@@ -54,4 +54,9 @@ export class VoiceboxController {
async speak(@Body() body: { text: string; profile: string; personality?: boolean }) { async speak(@Body() body: { text: string; profile: string; personality?: boolean }) {
return this.voiceboxService.speak(body.text, body.profile, body.personality); return this.voiceboxService.speak(body.text, body.profile, body.personality);
} }
@Delete('history/:id')
async deleteHistory(@Param('id') id: string) {
return this.voiceboxService.deleteHistory(id);
}
} }
+18
View File
@@ -237,4 +237,22 @@ export class VoiceboxService {
); );
} }
} }
/**
* Belirtilen ID'ye sahip VoiceBox geçmiş kaydını siler
*/
async deleteHistory(generationId: string) {
try {
const response: any = await lastValueFrom(
this.httpService.delete<any>(`${this.voiceboxUrl}/history/${generationId}`)
);
return response.data;
} catch (error: any) {
this.logger.error(`Error deleting VoiceBox history for ${generationId}`, error.message);
throw new HttpException(
'Geçmiş kaydı silinemedi',
HttpStatus.INTERNAL_SERVER_ERROR
);
}
}
} }