File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,15 @@ authRouter.post(
5858 try {
5959 if ( isAuthorizedByEmail ( req . body . email ) ) {
6060 const user = await userService . getUserByEmail ( req . body . email ) ;
61-
61+
6262 const activatedUser = user ;
6363 activatedUser . status = UserStatus . ACTIVE ;
6464 await userService . updateUserById ( user . id , activatedUser ) ;
6565
66- const rest = { ...{ accessToken : req . body . accessToken } , ...activatedUser } ;
66+ const rest = {
67+ ...{ accessToken : req . body . accessToken } ,
68+ ...activatedUser ,
69+ } ;
6770 res
6871 . cookie ( "refreshToken" , req . body . refreshToken , cookieOptions )
6972 . status ( 200 )
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ const get = async (): Promise<User[]> => {
1414 } ) ;
1515 return data ;
1616 } catch ( error ) {
17- throw new Error ( `Failed to get users. ${ error instanceof Error ? error . message : "Unknown error occured." } ` ) ;
17+ throw new Error (
18+ `Failed to get users. ${
19+ error instanceof Error ? error . message : "Unknown error occured."
20+ } `,
21+ ) ;
1822 }
1923} ;
2024
@@ -39,12 +43,16 @@ const invite = async (email: string): Promise<void> => {
3943 "accessToken" ,
4044 ) } `;
4145 try {
42- await baseAPIClient . post ( "/auth/invite-user" , { email } , {
43- headers : { Authorization : bearerToken } ,
44- } ) ;
46+ await baseAPIClient . post (
47+ "/auth/invite-user" ,
48+ { email } ,
49+ {
50+ headers : { Authorization : bearerToken } ,
51+ } ,
52+ ) ;
4553 } catch ( error ) {
46- throw new Error ( `Failed to invite user with email '${ email } '` )
54+ throw new Error ( `Failed to invite user with email '${ email } '` ) ;
4755 }
48- }
56+ } ;
4957
5058export default { get, create, invite } ;
You can’t perform that action at this time.
0 commit comments