File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ) ) ;
Original file line number Diff line number Diff line change @@ -550,14 +550,14 @@ export const blockToString = async (block: SlackRichTextBlock) => {
550550 */
551551export 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' :
You can’t perform that action at this time.
0 commit comments