mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
Bugfix/shared credentials not showing on ui (#5383)
* fix shared credentials not showing on ui * Enhance credential retrieval by including createdDate, updatedDate, and workspaceId fields; sanitize shared item data by omitting encryptedData.
This commit is contained in:
@@ -264,7 +264,7 @@ export class WorkspaceService {
|
||||
const itemIds = sharedItems.map((item) => item.sharedItemId)
|
||||
if (itemType === 'credential') {
|
||||
return await this.dataSource.getRepository(Credential).find({
|
||||
select: ['id', 'name', 'credentialName'],
|
||||
select: ['id', 'name', 'credentialName', 'createdDate', 'updatedDate', 'workspaceId'],
|
||||
where: { id: In(itemIds) }
|
||||
})
|
||||
} else if (itemType === 'custom_template') {
|
||||
|
||||
@@ -50,7 +50,7 @@ const deleteCredentials = async (credentialId: string): Promise<any> => {
|
||||
const getAllCredentials = async (paramCredentialName: any, workspaceId?: string) => {
|
||||
try {
|
||||
const appServer = getRunningExpressApp()
|
||||
let dbResponse = []
|
||||
let dbResponse: any[] = []
|
||||
if (paramCredentialName) {
|
||||
if (Array.isArray(paramCredentialName)) {
|
||||
for (let i = 0; i < paramCredentialName.length; i += 1) {
|
||||
@@ -83,14 +83,14 @@ const getAllCredentials = async (paramCredentialName: any, workspaceId?: string)
|
||||
if (sharedItem.credentialName === name) {
|
||||
// @ts-ignore
|
||||
sharedItem.shared = true
|
||||
dbResponse.push(sharedItem)
|
||||
dbResponse.push(omit(sharedItem, ['encryptedData']))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sharedItem.credentialName === paramCredentialName) {
|
||||
// @ts-ignore
|
||||
sharedItem.shared = true
|
||||
dbResponse.push(sharedItem)
|
||||
dbResponse.push(omit(sharedItem, ['encryptedData']))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ const getAllCredentials = async (paramCredentialName: any, workspaceId?: string)
|
||||
for (const sharedItem of sharedItems) {
|
||||
// @ts-ignore
|
||||
sharedItem.shared = true
|
||||
dbResponse.push(sharedItem)
|
||||
dbResponse.push(omit(sharedItem, ['encryptedData']))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user