Skip to content

Commit 76880e8

Browse files
committed
test fix
1 parent a948edc commit 76880e8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/backend/src/controllers/users.controllers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class UsersController {
1515

1616
static async getAllOrgUsers(req: Request, res: Response, next: NextFunction) {
1717
try {
18-
const users = await UsersService.getAllOrgUsers(req.organization);
18+
const users = await UsersService.getAllOrgUsers(req.organization.organizationId);
1919
res.status(200).json(users);
2020
} catch (error: unknown) {
2121
next(error);

src/backend/src/services/users.services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export default class UsersService {
5656
* @param organization the organization to get the users from
5757
* @returns a list of all the users in the current organization
5858
*/
59-
static async getAllOrgUsers(organization: Organization): Promise<User[]> {
59+
static async getAllOrgUsers(organizationId: string): Promise<User[]> {
6060
const users = await prisma.user.findMany({
61-
where: { organizations: { some: { organizationId: organization.organizationId } } },
62-
...getUserQueryArgs(organization.organizationId)
61+
where: { organizations: { some: { organizationId } } },
62+
...getUserQueryArgs(organizationId)
6363
});
6464

6565
users.sort((a, b) => a.firstName.localeCompare(b.firstName));

src/backend/src/utils/slack.utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,14 @@ export const blockToString = async (block: SlackRichTextBlock) => {
550550
*/
551551
export const blockToMentionedUsers = async (
552552
block: SlackRichTextBlock,
553-
_organizationId: string,
553+
organizationId: string,
554554
channelId: string
555555
): Promise<string[]> => {
556556
switch (block.type) {
557557
case 'broadcast':
558558
switch (block.range) {
559559
case 'everyone':
560-
const usersInOrg = await UsersService.getAllUsers();
560+
const usersInOrg = await UsersService.getAllOrgUsers(organizationId);
561561
return usersInOrg.map((user) => user.userId);
562562
case 'channel':
563563
case 'here':

0 commit comments

Comments
 (0)