remove open ai key validation

This commit is contained in:
Victor Calazans 2025-06-25 19:30:15 -03:00
parent 39606240da
commit 2c780089aa

View File

@ -236,15 +236,15 @@ export class OpenaiController extends BaseChatbotController<OpenaiBot, OpenaiDto
if (!data.name) throw new BadRequestException('Name is required'); if (!data.name) throw new BadRequestException('Name is required');
// Check if API key already exists // Check if API key already exists
const existingApiKey = await this.credsRepository.findFirst({ // const existingApiKey = await this.credsRepository.findFirst({
where: { // where: {
apiKey: data.apiKey, // apiKey: data.apiKey,
}, // },
}); // });
if (existingApiKey) { // if (existingApiKey) {
throw new BadRequestException('This API key is already registered. Please use a different API key.'); // throw new BadRequestException('This API key is already registered. Please use a different API key.');
} // }
// Check if name already exists for this instance // Check if name already exists for this instance
const existingName = await this.credsRepository.findFirst({ const existingName = await this.credsRepository.findFirst({