Fix for 1869 Issue of Update Crendential (#2260)

Fix 1869 Issue of Update Crendential
bugfix/Assistant-File-Download
Naga31 2024-04-26 20:40:47 +05:30 committed by GitHub
parent fa3d21bc30
commit 51058b2a31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,8 @@ const updateCredential = async (credentialId: string, requestBody: any): Promise
if (!credential) {
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Credential ${credentialId} not found`)
}
const decryptedCredentialData = await decryptCredentialData(credential.encryptedData)
requestBody.plainDataObj = { ...decryptedCredentialData, ...requestBody.plainDataObj }
const updateCredential = await transformToCredentialEntity(requestBody)
await appServer.AppDataSource.getRepository(Credential).merge(credential, updateCredential)
const dbResponse = await appServer.AppDataSource.getRepository(Credential).save(credential)