Skip to content

Commit c77b08a

Browse files
authored
Merge pull request #435 from ELEVATE-Project/staging
Staging
2 parents 68770b4 + a458ac9 commit c77b08a

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

release-notes/2.6.0.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,32 @@
4646
src/scripts$ node encryptDecryptEmails.js decrypt
4747
```
4848
49+
2. **API Permissions:**
50+
- The API can only be accessed using the appropriate permissions.
51+
4952
### Enhancements:
5053
54+
1. **Re-Build Materialized Views :**
55+
56+
- To update the views
57+
58+
**Steps to rebuild the meterialize views :**
59+
60+
- Run the below curl
61+
62+
```
63+
curl --location --request GET 'http://localhost:7101/user/v1/admin/triggerViewRebuildInternal' \
64+
--header 'internal_access_token: INTERNAL_ACCESS_TOKEN'
65+
```
66+
2. **Upload the latest sample csv**
67+
68+
- To upload the latest sample csv, run the below commmand
69+
70+
```
71+
cd scripts/
72+
node -r module-alias/register uploadSampleCSV.js
73+
```
74+
5175
### Bug Fixes:
5276

5377
### Infrastructure:

src/services/account.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,30 @@ module.exports = class AccountHelper {
895895
delete user.password
896896
delete user.otpInfo
897897

898+
let defaultOrg = await organizationQueries.findOne(
899+
{ code: process.env.DEFAULT_ORGANISATION_CODE },
900+
{ attributes: ['id'] }
901+
)
902+
let defaultOrgId = defaultOrg.id
903+
const modelName = await userQueries.getModelName()
904+
905+
let validationData = await entityTypeQueries.findUserEntityTypesAndEntities({
906+
status: 'ACTIVE',
907+
organization_id: {
908+
[Op.in]: [user.organization_id, defaultOrgId],
909+
},
910+
model_names: { [Op.contains]: [modelName] },
911+
})
912+
913+
const prunedEntities = removeDefaultOrgEntityTypes(validationData, user.organization_id)
914+
user = utils.processDbResponse(user, prunedEntities)
915+
898916
// Check if user and user.image exist, then fetch a downloadable URL for the image
899-
if (user && user.image) user.image = await utils.getDownloadableUrl(user.image)
917+
if (user && user.image) {
918+
user.image = await utils.getDownloadableUrl(user.image)
919+
}
920+
user.email = plaintextEmailId
921+
900922
const result = { access_token: accessToken, refresh_token: refreshToken, user }
901923
return responses.successResponse({
902924
statusCode: httpStatusCode.ok,

0 commit comments

Comments
 (0)