Skip to content

Commit 93c324f

Browse files
committed
Merge remote-tracking branch 'origin/dev' into misc/add-github-workflow
2 parents 552f2db + 84b3823 commit 93c324f

File tree

49 files changed

+567
-494
lines changed

Some content is hidden

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

49 files changed

+567
-494
lines changed

global.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ interface TInvite {
5252
organizationName: string;
5353
code: string;
5454
email: string;
55+
name: string;
5556
createdAt: Date;
5657
}
5758

@@ -60,7 +61,8 @@ interface TMember {
6061
organizationId: string;
6162
fullName: string;
6263
email: string;
63-
created_at: Date;
64+
name: string;
65+
created: Date;
6466
active: boolean;
6567
activation_token: string;
6668
}

src/api/organizations/getInviteByCodeApi.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fetchApiWithAuthRequest } from '../fetchApi';
22
import { endpoints } from '../endpoints';
33
import { httpMethods } from '../constants';
44
import { apiUrl } from '../apiUrl';
5-
import mockApi from '../mockApiData';
5+
// import mockApi from '../mockApiData';
66

77
const getInviteByCodeApi = ({
88
username,
@@ -15,13 +15,6 @@ const getInviteByCodeApi = ({
1515
url: apiUrl(endpoints.organizations.reGenerateToken(username)),
1616
method: httpMethods.put,
1717
authenticationToken,
18-
}).catch((res) => {
19-
if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
20-
res = {
21-
data: mockApi.myOrganizationMockResponse.myOrganizationInviteMockResponse,
22-
};
23-
}
24-
return res;
2518
});
2619

2720
export default getInviteByCodeApi;

src/api/organizations/inviteApi.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@ import mockApi from '../mockApiData';
77
const inviteApi = ({
88
authenticationToken,
99
name,
10-
email,
1110
}: {
1211
authenticationToken: string;
1312
name: string;
14-
email: string;
15-
}): Promise<void> =>
16-
fetchApiWithAuthRequest({
13+
}): Promise<void> =>
14+
fetchApiWithAuthRequest({
1715
url: apiUrl(endpoints.organizations.invite),
1816
method: httpMethods.post,
1917
authenticationToken,
2018
headers: {
2119
'Content-Type': 'application/json',
2220
},
2321
data: JSON.stringify({
24-
name,
25-
email,
22+
name
2623
}),
2724
}).catch((res) => {
2825
if (process.env.REACT_APP_MOCKAPI_RESPONSE) {

src/api/session/emailUpdate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { apiUrl } from '../apiUrl';
55

66
const emailUpdate = ({
77
userId,
8-
email,
8+
fullName,
99
name,
1010
authenticationToken,
1111
}: {
1212
userId: string,
13-
email: string
13+
fullName: string
1414
name: string;
1515
authenticationToken: string;
1616
}): Promise<TUser> =>
@@ -21,7 +21,7 @@ const emailUpdate = ({
2121
headers: {
2222
'Content-Type': 'application/json',
2323
},
24-
data: { email, name },
24+
data: { full_name: fullName, name },
2525
});
2626

2727
export default emailUpdate;

src/api/session/loginApi.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ interface Params {
3030
// password: account.password,
3131
// }),
3232
// }).catch((res) => {
33-
// // if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
33+
// if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
3434
// res = {
3535
// data: mockApi.loginMockResponse,
3636
// };
37-
// // }
37+
// }
3838
// return res;
3939
// });
4040

@@ -50,4 +50,5 @@ const loginApi = ({ account }: Params): Promise<Response> =>
5050
password: account.password,
5151
}),
5252
});
53+
5354
export default loginApi;

src/api/session/signUpApi.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export interface Response {
99
}
1010

1111
interface NewAccount {
12+
userId: string;
1213
username: string;
13-
fullname: any;
14+
fullName: any;
1415
email: string;
1516
password: string;
1617
token: string;
@@ -22,14 +23,14 @@ interface Params {
2223

2324
const signUpApi = ({ account }: Params): Promise<void> =>
2425
fetchApi({
25-
url: apiUrl(endpoints.signup(account.username)),
26+
url: apiUrl(endpoints.signup(account.userId)),
2627
method: httpMethods.put,
2728
headers: {
2829
'Content-Type': 'application/json',
2930
},
3031
data: JSON.stringify({
3132
name: account.username,
32-
full_name: account.fullname,
33+
full_name: account.fullName,
3334
email: account.email,
3435
password: account.password,
3536
activation_token: account.token

src/api/users/getMyUserApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fetchApiWithAuthRequest } from '../fetchApi';
2-
import { endpoints } from '../endpoints';
2+
import { endpoints } from '../endpoints';
33
import { httpMethods } from '../constants';
44
import { apiUrl } from '../apiUrl';
55
import mockApi from '../mockApiData';

src/redux/actions/organizations/inviteAction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import inviteApi from '../../../api/organizations/inviteApi';
33

44
export const inviteAction = ({
55
name,
6-
email,
76
onFailure,
87
onSuccess,
98
}: {
109
name: string;
11-
email: string;
1210
onFailure?: (err: any) => void;
1311
onSuccess?: () => void;
1412
}): TRequestAction => ({
@@ -18,7 +16,7 @@ export const inviteAction = ({
1816
isAuthenticated: true,
1917
failureActionType: organizationActionTypes.invite.failure,
2018
successActionType: organizationActionTypes.invite.success,
21-
params: { name, email },
19+
params: { name },
2220
onFailure,
2321
onSuccess,
2422
},

src/redux/actions/session/emailUpdate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import emailUpdateApi from '../../../api/session/emailUpdate';
33

44
export const emailUpdateAction = ({
55
userId,
6-
email,
6+
fullName,
77
name,
88
onSuccess,
99
onFailure,
1010
}: {
1111
userId: string;
12-
email: string;
12+
fullName: string;
1313
name: string;
1414
onSuccess?: () => void;
1515
onFailure?: () => void;
@@ -22,6 +22,6 @@ export const emailUpdateAction = ({
2222
successActionType: updateEmailTypes.success,
2323
onSuccess,
2424
onFailure,
25-
params: { userId, email, name },
25+
params: { userId, fullName, name },
2626
},
2727
});

src/redux/actions/session/signupAction.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { signupActionTypes } from '../../actionTypes';
22
import signUpApi from '../../../api/session/signUpApi';
33

44
export const signUpAction = ({
5+
userId,
56
username,
67
email,
78
fullName,
@@ -10,6 +11,7 @@ export const signUpAction = ({
1011
onSuccess,
1112
onFailure,
1213
}: {
14+
userId: string;
1315
username: string;
1416
email: string;
1517
fullName: string;
@@ -28,6 +30,7 @@ export const signUpAction = ({
2830
onFailure,
2931
params: {
3032
account: {
33+
userId,
3134
username,
3235
email,
3336
fullName,

0 commit comments

Comments
 (0)