Skip to content

Commit

Permalink
restrict data for getting user types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanmtz committed Jan 22, 2025
1 parent 8173189 commit 15d510a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/users/userTypes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { at } = require('core-js/core/string')
const models = require('../../models')
const Promise = require('bluebird')

Expand All @@ -8,13 +9,17 @@ module.exports = Promise.method(async function userTypes (userId) {
id: userId
},
include: [
models.Type
]
{
model: models.Type,
as: 'Types',
attributes: ['id', 'name']
}
],
attributes: ['id', 'name', 'profile_url', 'picture_url', 'website']
}).then(async user => {
if (!user) {
return {}
}

return user
}).catch(error => {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit 15d510a

Please sign in to comment.