@@ -39,7 +39,7 @@ export default async function addFileAdapter(request) {
39
39
// assign existing file adapters or empty array
40
40
let updatedFileAdapters = existsFileAdaptes ;
41
41
const uniqueId = generateId ( 10 ) ;
42
- const id = extUser ?. get ( 'TenantId' ) ?. id + '_' + uniqueId ;
42
+ let id = extUser ?. get ( 'TenantId' ) ?. id + '_' + uniqueId ;
43
43
const index = updatedFileAdapters ?. findIndex ( x => x . fileAdapterName === fileAdapterName ) ;
44
44
45
45
if ( index !== - 1 ) {
@@ -52,6 +52,7 @@ export default async function addFileAdapter(request) {
52
52
} else {
53
53
const adapterConfig = { accessKeyId : accessKeyId , secretAccessKey : secretAccessKey } ;
54
54
updatedFileAdapters [ index ] = { ...updatedFileAdapters [ index ] , ...adapterConfig } ;
55
+ id = updatedFileAdapters [ index ] . id ;
55
56
}
56
57
} else {
57
58
if ( bucketName && region && endpoint && baseUrl ) {
@@ -90,7 +91,8 @@ export default async function addFileAdapter(request) {
90
91
protectedFields : { '*' : [ 'FileAdapters' ] } ,
91
92
} ) ;
92
93
await tenantSchema . update ( ) ;
93
- return updateTenant . updatedAt ;
94
+ const ActiveFileAdapter = adapter === 'opensign' ? 'opensign' : id ;
95
+ return { ActiveFileAdapter : ActiveFileAdapter , updateAt : updateTenant . updatedAt } ;
94
96
} else {
95
97
throw new Parse . Error ( Parse . Error . OBJECT_NOT_FOUND , 'User not found.' ) ;
96
98
}
@@ -123,7 +125,7 @@ export default async function addFileAdapter(request) {
123
125
protectedFields : { '*' : [ 'FileAdapters' ] } ,
124
126
} ) ;
125
127
await tenantSchema . update ( ) ;
126
- return updateTenant . updatedAt ;
128
+ return { ActiveFileAdapter : 'opensign' , updateAt : updateTenant . updatedAt } ;
127
129
} else {
128
130
throw new Parse . Error ( Parse . Error . OBJECT_NOT_FOUND , 'User not found.' ) ;
129
131
}
0 commit comments