Improve infra as code support (#4867)
* Fix: enable creating of documentstores with the loaders * Feature: Support posting credentials with a specific id to enabled infrastructure as code
This commit is contained in:
parent
e8c36b6894
commit
d77919ba50
|
|
@ -299,8 +299,8 @@ export class DocumentStoreDTO {
|
|||
static toEntity(body: any): DocumentStore {
|
||||
const docStore = new DocumentStore()
|
||||
Object.assign(docStore, body)
|
||||
docStore.loaders = '[]'
|
||||
docStore.whereUsed = '[]'
|
||||
docStore.loaders = body.loaders ?? '[]'
|
||||
docStore.whereUsed = body.whereUsed ?? '[]'
|
||||
// when a new document store is created, it is empty and in sync
|
||||
docStore.status = DocumentStoreStatus.EMPTY_SYNC
|
||||
return docStore
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ const createCredential = async (requestBody: any) => {
|
|||
try {
|
||||
const appServer = getRunningExpressApp()
|
||||
const newCredential = await transformToCredentialEntity(requestBody)
|
||||
|
||||
if (requestBody.id) {
|
||||
newCredential.id = requestBody.id
|
||||
}
|
||||
|
||||
const credential = await appServer.AppDataSource.getRepository(Credential).create(newCredential)
|
||||
const dbResponse = await appServer.AppDataSource.getRepository(Credential).save(credential)
|
||||
return dbResponse
|
||||
|
|
|
|||
Loading…
Reference in New Issue