Skip to content

Commit f3effbc

Browse files
Merge branch 'dev' into talha/feedback-fixes
2 parents dc25df3 + 91ae789 commit f3effbc

File tree

36 files changed

+430
-377
lines changed

36 files changed

+430
-377
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/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,

src/services/locales/zu.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
"label": "Change Password",
6464
"button": "Change Password"
6565
},
66-
"emailNameReset": {
67-
"label": "Change Email and Username",
68-
"button": "Change Email and Username"
66+
"nameReset": {
67+
"label": "Save Changes",
68+
"button": "Save Changes"
6969
},
7070
"toasts": {
7171
"successful": {
@@ -76,8 +76,8 @@
7676
}
7777
},
7878
"popup": {
79-
"title": "Change Email and Username",
80-
"text": "Are you sure to change your email and username",
79+
"title": "Change full name and Username",
80+
"text": "Are you sure to change your full name and username",
8181
"successButton": {
8282
"text": "Yes"
8383
},
@@ -165,11 +165,10 @@
165165
},
166166
"popup": {
167167
"title": "Add a new Member",
168-
"email": {
169-
"label": "Email",
170-
"placeholder": "Email",
171-
"required": "Email is required",
172-
"invalidEmail": "Email is not valid"
168+
"username": {
169+
"label": "Username",
170+
"placeholder": "Username",
171+
"required": "Username is required"
173172
},
174173
"role": {
175174
"label": "Role",
@@ -180,8 +179,8 @@
180179
"text": "Invite"
181180
},
182181
"generateInviteModal": {
183-
"title": "Invitation Token",
184-
"text": "Click generate token to re-generate invitation for",
182+
"title": "New Invitation Token",
183+
"text": " Generate a new invite token for",
185184
"button": {
186185
"text": "Generate Token"
187186
}

0 commit comments

Comments
 (0)