Skip to content

Commit

Permalink
Merge pull request #435 from ELEVATE-Project/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
rakeshSgr authored Mar 11, 2024
2 parents 68770b4 + a458ac9 commit c77b08a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
24 changes: 24 additions & 0 deletions release-notes/2.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,32 @@
src/scripts$ node encryptDecryptEmails.js decrypt
```
2. **API Permissions:**
- The API can only be accessed using the appropriate permissions.
### Enhancements:
1. **Re-Build Materialized Views :**
- To update the views
**Steps to rebuild the meterialize views :**
- Run the below curl
```
curl --location --request GET 'http://localhost:7101/user/v1/admin/triggerViewRebuildInternal' \
--header 'internal_access_token: INTERNAL_ACCESS_TOKEN'
```
2. **Upload the latest sample csv**
- To upload the latest sample csv, run the below commmand
```
cd scripts/
node -r module-alias/register uploadSampleCSV.js
```

### Bug Fixes:

### Infrastructure:
Expand Down
24 changes: 23 additions & 1 deletion src/services/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,30 @@ module.exports = class AccountHelper {
delete user.password
delete user.otpInfo

let defaultOrg = await organizationQueries.findOne(
{ code: process.env.DEFAULT_ORGANISATION_CODE },
{ attributes: ['id'] }
)
let defaultOrgId = defaultOrg.id
const modelName = await userQueries.getModelName()

let validationData = await entityTypeQueries.findUserEntityTypesAndEntities({
status: 'ACTIVE',
organization_id: {
[Op.in]: [user.organization_id, defaultOrgId],
},
model_names: { [Op.contains]: [modelName] },
})

const prunedEntities = removeDefaultOrgEntityTypes(validationData, user.organization_id)
user = utils.processDbResponse(user, prunedEntities)

// Check if user and user.image exist, then fetch a downloadable URL for the image
if (user && user.image) user.image = await utils.getDownloadableUrl(user.image)
if (user && user.image) {
user.image = await utils.getDownloadableUrl(user.image)
}
user.email = plaintextEmailId

const result = { access_token: accessToken, refresh_token: refreshToken, user }
return responses.successResponse({
statusCode: httpStatusCode.ok,
Expand Down

0 comments on commit c77b08a

Please sign in to comment.