@@ -86,10 +86,8 @@ function createCouchDBUser({
8686 }
8787 debug ( 'createCouchDBUser whichUserGroup' , whichUserGroup ) ;
8888 const couchdb = nano ( {
89- requestDefaults : {
90- headers : {
91- 'x-request-id' : req . id || '' ,
92- } ,
89+ headers : {
90+ 'x-request-id' : req . id || '' ,
9391 } ,
9492 url : couchConnectUrl ,
9593 } ) ;
@@ -139,13 +137,11 @@ function createCouchDBUser({
139137 debug ( `${ new Date ( ) } User activity feed successfully replicated.` , couchActivityFeedResponse ) ;
140138 // Set up security on new user activity feed
141139 const activityDb = nano ( {
142- requestDefaults : {
143- headers : {
144- 'x-request-id' : req . id || '' ,
145- } ,
140+ headers : {
141+ 'x-request-id' : req . id || '' ,
146142 } ,
147- url : ` ${ couchConnectUrl } / ${ user . username } -activity_feed` ,
148- } ) ;
143+ url : couchConnectUrl ,
144+ } ) . use ( ` ${ user . username } -activity_feed` ) ;
149145 return activityDb . insert ( {
150146 admins : {
151147 names : [ ] ,
@@ -206,10 +202,8 @@ function fetchCorpusPermissions({
206202 }
207203 debug ( `${ new Date ( ) } ${ requestingUser } requested the team on ${ dbname } ` ) ;
208204 const nanoforpermissions = nano ( {
209- requestDefaults : {
210- headers : {
211- 'x-request-id' : req . id || '' ,
212- } ,
205+ headers : {
206+ 'x-request-id' : req . id || '' ,
213207 } ,
214208 url : couchConnectUrl ,
215209 } ) ;
@@ -445,10 +439,8 @@ function saveUpdateUserToDatabase({
445439
446440 // Preparing the couch connection
447441 const usersdb = nano ( {
448- requestDefaults : {
449- headers : {
450- 'x-request-id' : req . id || '' ,
451- } ,
442+ headers : {
443+ 'x-request-id' : req . id || '' ,
452444 } ,
453445 url : couchConnectUrl ,
454446 } ) . db . use ( config . usersDbConnection . dbname ) ;
@@ -508,10 +500,8 @@ function findByUsername({
508500 }
509501
510502 const usersdb = nano ( {
511- requestDefaults : {
512- headers : {
513- 'x-request-id' : req . id || '' ,
514- } ,
503+ headers : {
504+ 'x-request-id' : req . id || '' ,
515505 } ,
516506 url : couchConnectUrl ,
517507 } ) . db . use ( config . usersDbConnection . dbname ) ;
@@ -582,10 +572,8 @@ function findByEmail({
582572 }
583573 usersQuery = `${ usersQuery } ?key="${ email } "` ;
584574 const usersdb = nano ( {
585- requestDefaults : {
586- headers : {
587- 'x-request-id' : req . id || '' ,
588- } ,
575+ headers : {
576+ 'x-request-id' : req . id || '' ,
589577 } ,
590578 url : couchConnectUrl ,
591579 } ) . db . use ( config . usersDbConnection . dbname ) ;
@@ -1501,10 +1489,8 @@ function registerNewUser({
15011489 // debug(`${new Date()} There was success in creating the corpus: ${JSON.stringify(result.info)}\n`);
15021490 // /* Save corpus, datalist and session docs so that apps can load the dashboard for the user */
15031491 // const db = nano({
1504- // requestDefaults: {
1505- // headers: {
1506- // 'x-request-id': req.id,
1507- // },
1492+ // headers: {
1493+ // 'x-request-id': req.id,
15081494 // },
15091495 // url: `${couchConnectUrl}/${corpusDetails.dbname}`,
15101496 // });
0 commit comments