Merge branch 'fix/login-struct-change' into 'release'

Updating login structure as per backend

See merge request theappsmith/internal-tools-client!351
This commit is contained in:
Satbir Singh 2020-03-06 06:54:44 +00:00
commit 02a01c700a
2 changed files with 8 additions and 2 deletions

View File

@ -6,5 +6,5 @@ export type User = {
};
export const CurrentUserDetailsRequestPayload = {
id: "me",
id: "profile",
};

View File

@ -265,11 +265,17 @@ export function* fetchUserSaga(action: ReduxAction<FetchUserRequest>) {
try {
const request: FetchUserRequest = action.payload;
const response: FetchUserResponse = yield call(UserApi.fetchUser, request);
const { user, applications, currentOrganization } = response.data;
const finalData = {
...user,
applications,
currentOrganization,
};
const isValidResponse = yield validateResponse(response);
if (isValidResponse) {
yield put({
type: ReduxActionTypes.FETCH_USER_SUCCESS,
payload: response.data,
payload: finalData,
});
return yield response.data;
}