feat(gql): adds company and avatar to StreamCollaborator

This commit is contained in:
Matteo Cominetti
2020-10-14 19:27:05 +01:00
parent 7d0115c74d
commit b0ea8e6499
4 changed files with 46 additions and 52 deletions
+41 -50
View File
@@ -1,53 +1,44 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2020": true
},
"parserOptions": {
"ecmaVersion": 11
},
"ignorePatterns": [
"modules/*/tests/*",
"node_modules/*",
"frontend/*"
"env": {
"browser": true,
"commonjs": true,
"es2020": true
},
"parserOptions": {
"ecmaVersion": 11
},
"ignorePatterns": [
"modules/*/tests/*",
"node_modules/*",
"frontend/*",
"*.graphql"
],
"rules": {
"arrow-spacing": [
2,
{
"before": true,
"after": true
}
],
"rules": {
"arrow-spacing": [
2,
{
"before": true,
"after": true
}
],
"array-bracket-spacing": [
2,
"always"
],
"block-spacing": [
2,
"always"
],
"camelcase": [
1,
{
"properties": "always"
}
],
"space-in-parens": [
2,
"always"
],
"keyword-spacing": 2,
"semi": "off",
"indent": [
"error",
2
],
"space-unary-ops": [
2, {
"words": true,
"nonwords": false
}]
}
"array-bracket-spacing": [2, "always"],
"block-spacing": [2, "always"],
"camelcase": [
1,
{
"properties": "always"
}
],
"space-in-parens": [2, "always"],
"keyword-spacing": 2,
"semi": "off",
"indent": ["error", 2],
"space-unary-ops": [
2,
{
"words": true,
"nonwords": false
}
]
}
}
+1
View File
@@ -0,0 +1 @@
*.graphql
@@ -32,6 +32,8 @@ type StreamCollaborator {
id: String!
name: String!
role: String!
company: String
avatar: String
}
type StreamCollection {
+2 -2
View File
@@ -140,10 +140,10 @@ module.exports = {
async getStreamUsers( { streamId } ) {
let query =
Acl( ).columns( { role: 'stream_acl.role' }, 'id', 'name' ).select( )
Acl( ).columns( { role: 'stream_acl.role' }, 'id', 'name', 'company', 'avatar' ).select( )
.where( { resourceId: streamId } )
.rightJoin( 'users', { 'users.id': 'stream_acl.userId' } )
.select( 'stream_acl.role', 'name', 'id' )
.select( 'stream_acl.role', 'name', 'id', 'company', 'avatar' )
.orderBy( 'stream_acl.role' )
return await query