Skip to content

Commit a0406af

Browse files
committed
chore: merge main into release for new releases
2 parents e5dfc70 + 6723905 commit a0406af

File tree

60 files changed

+609
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+609
-30
lines changed

apps/api/src/auth/hybrid-auth.guard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ export class HybridAuthGuard implements CanActivate {
232232
where: {
233233
userId,
234234
organizationId,
235+
deactivated: false,
235236
},
236237
select: {
237238
id: true,

apps/api/src/comments/comments.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class CommentsService {
116116
name: comment.author.user.name,
117117
email: comment.author.user.email,
118118
image: comment.author.user.image,
119+
deactivated: comment.author.deactivated,
119120
},
120121
attachments,
121122
createdAt: comment.createdAt,
@@ -154,6 +155,7 @@ export class CommentsService {
154155
where: {
155156
userId,
156157
organizationId,
158+
deactivated: false,
157159
},
158160
include: {
159161
user: true,
@@ -211,6 +213,7 @@ export class CommentsService {
211213
name: member.user.name,
212214
email: member.user.email,
213215
image: member.user.image,
216+
deactivated: member.deactivated,
214217
},
215218
attachments: result.attachments,
216219
createdAt: result.comment.createdAt,
@@ -284,6 +287,7 @@ export class CommentsService {
284287
name: existingComment.author.user.name,
285288
email: existingComment.author.user.email,
286289
image: existingComment.author.user.image,
290+
deactivated: existingComment.author.deactivated,
287291
},
288292
attachments,
289293
createdAt: updatedComment.createdAt,

apps/api/src/comments/dto/comment-responses.dto.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ export class AuthorResponseDto {
8989
nullable: true,
9090
})
9191
image: string | null;
92+
93+
@ApiProperty({
94+
description: 'Whether the user is deactivated',
95+
example: false,
96+
nullable: true,
97+
})
98+
deactivated: boolean;
9299
}
93100

94101
export class CommentResponseDto {

apps/api/src/devices/devices.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export class DevicesService {
9797
where: {
9898
id: memberId,
9999
organizationId: organizationId,
100+
deactivated: false,
100101
},
101102
select: {
102103
id: true,
@@ -165,6 +166,7 @@ export class DevicesService {
165166
where: {
166167
id: memberId,
167168
organizationId: organizationId,
169+
deactivated: false,
168170
},
169171
select: {
170172
id: true,

apps/api/src/people/utils/member-queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class MemberQueries {
4040
organizationId: string,
4141
): Promise<PeopleResponseDto[]> {
4242
return db.member.findMany({
43-
where: { organizationId },
43+
where: { organizationId, deactivated: false },
4444
select: this.MEMBER_SELECT,
4545
orderBy: { createdAt: 'desc' },
4646
});

apps/api/src/people/utils/member-validator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export class MemberValidator {
4747
where: {
4848
id: memberId,
4949
organizationId,
50+
deactivated: false,
5051
},
5152
select: { id: true, userId: true },
5253
});
@@ -71,6 +72,7 @@ export class MemberValidator {
7172
const whereClause: any = {
7273
userId,
7374
organizationId,
75+
deactivated: false,
7476
};
7577

7678
if (excludeMemberId) {

apps/app/src/actions/add-comment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const addCommentAction = authActionClient
3838
where: {
3939
userId: session.userId,
4040
organizationId: session.activeOrganizationId,
41+
deactivated: false,
4142
},
4243
});
4344

apps/app/src/actions/change-organization.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const changeOrganizationAction = authActionClient
2828
where: {
2929
userId: user.id,
3030
organizationId,
31+
deactivated: false,
3132
},
3233
});
3334

apps/app/src/actions/organization/accept-invitation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const completeInvitation = authActionClientWithoutOrg
6969
where: {
7070
userId: user.id,
7171
organizationId: invitation.organizationId,
72+
deactivated: false,
7273
},
7374
});
7475

apps/app/src/actions/organization/get-organization-users-action.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const getOrganizationUsersAction = authActionClient
2626
const users = await db.member.findMany({
2727
where: {
2828
organizationId: ctx.session.activeOrganizationId,
29+
deactivated: false,
2930
},
3031
select: {
3132
user: {

0 commit comments

Comments
 (0)