Commit 304221ba authored by Varunkumar Manohar's avatar Varunkumar Manohar
Browse files

fix: make sub-to-email default and set cache expiry to one hour for user assoc svc responses

parent f230454a
Pipeline #67820 passed with stages
in 12 minutes and 20 seconds
...@@ -183,6 +183,7 @@ paths: ...@@ -183,6 +183,7 @@ paths:
name: subid-to-email name: subid-to-email
in: query in: query
type: boolean type: boolean
default: true
enum: enum:
- true - true
- false - false
...@@ -1161,6 +1162,7 @@ paths: ...@@ -1161,6 +1162,7 @@ paths:
name: subid-to-email name: subid-to-email
in: query in: query
type: boolean type: boolean
default: true
enum: enum:
- true - true
- false - false
......
...@@ -191,6 +191,7 @@ paths: ...@@ -191,6 +191,7 @@ paths:
type: boolean type: boolean
- description: 'If the dataset creator value is a subid, then enable conversion of it to email' - description: 'If the dataset creator value is a subid, then enable conversion of it to email'
name: subid-to-email name: subid-to-email
default: true
in: query in: query
type: boolean type: boolean
enum: enum:
...@@ -1163,6 +1164,7 @@ paths: ...@@ -1163,6 +1164,7 @@ paths:
default: common default: common
- description: 'Convert subid value of subproject admin to email' - description: 'Convert subid value of subproject admin to email'
name: subid-to-email name: subid-to-email
default: true
in: query in: query
type: boolean type: boolean
enum: enum:
......
...@@ -9,8 +9,8 @@ export class DESUserAssociation { ...@@ -9,8 +9,8 @@ export class DESUserAssociation {
private static _cache: Cache<string>; private static _cache: Cache<string>;
// User association details cached for a day // User association details cached for an hour
private static _cacheEntryTTL = 86400; private static _cacheEntryTTL = 3600;
public static async convertSubIdToEmail(appkey: string, subId: string, dataPartitionID: string): Promise<string> { public static async convertSubIdToEmail(appkey: string, subId: string, dataPartitionID: string): Promise<string> {
......
...@@ -256,7 +256,7 @@ export class DatasetHandler { ...@@ -256,7 +256,7 @@ export class DatasetHandler {
// parse user request // parse user request
const userInput = DatasetParser.get(req); const userInput = DatasetParser.get(req);
const datasetIN = userInput[0]; const datasetIN = userInput[0];
const convertSubIdToEmail = userInput[2]; const convertSubIdToEmail = (userInput[2] !== undefined) ? userInput[2] : true;
// retrieve journalClient client // retrieve journalClient client
const journalClient = JournalFactoryTenantClient.get(tenant); const journalClient = JournalFactoryTenantClient.get(tenant);
......
...@@ -192,7 +192,7 @@ export class SubProjectHandler { ...@@ -192,7 +192,7 @@ export class SubProjectHandler {
// init journalClient client // init journalClient client
const journalClient = JournalFactoryTenantClient.get(tenant); const journalClient = JournalFactoryTenantClient.get(tenant);
const convertSubIdToEmail = req.query['subid-to-email'] === 'true'; const convertSubIdToEmail = (req.query['subid-to-email'] !== undefined) ? req.query['subid-to-email'] : 'true';
// get subproject // get subproject
const subproject = await SubProjectDAO.get(journalClient, tenant.name, req.params.subprojectid); const subproject = await SubProjectDAO.get(journalClient, tenant.name, req.params.subprojectid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment