Merge branch '2131-crud-for-messages' into Contribution-Messages

This commit is contained in:
ogerly 2022-08-24 16:45:59 +02:00
commit 0eb63689ee
3 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,7 @@ export enum RIGHTS {
COMMUNITY_STATISTICS = 'COMMUNITY_STATISTICS',
SEARCH_ADMIN_USERS = 'SEARCH_ADMIN_USERS',
CREATE_CONTRIBUTION_MESSAGE = 'CREATE_CONTRIBUTION_MESSAGE',
LIST_ALL_CONTRIBUTION_MESSAGES = 'LIST_ALL_CONTRIBUTION_MESSAGES',
// Admin
SEARCH_USERS = 'SEARCH_USERS',
SET_USER_ROLE = 'SET_USER_ROLE',

View File

@ -32,6 +32,7 @@ export const ROLE_USER = new Role('user', [
RIGHTS.LIST_CONTRIBUTION_LINKS,
RIGHTS.COMMUNITY_STATISTICS,
RIGHTS.CREATE_CONTRIBUTION_MESSAGE,
RIGHTS.LIST_ALL_CONTRIBUTION_MESSAGES,
])
export const ROLE_ADMIN = new Role('admin', Object.values(RIGHTS)) // all rights

View File

@ -98,8 +98,8 @@ export class ContributionResolver {
.createQueryBuilder()
.select('c')
.from(dbContribution, 'c')
.innerJoinAndSelect('c.messages', 'm')
.innerJoinAndSelect('m.user', 'u')
.leftJoinAndSelect('c.messages', 'm')
.leftJoinAndSelect('m.user', 'u')
.orderBy('c.createdAt', order)
.limit(pageSize)
.offset((currentPage - 1) * pageSize)