Skip to content

Commit

Permalink
Fix error in handling the logged in user response (amundsen-io#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttannis authored May 8, 2019
1 parent 6852d0b commit 7c824f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/amundsen_application/static/js/ducks/user/api/v0.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios, { AxiosResponse, AxiosError } from 'axios';

import { LoggedInUser, UserResponse } from '../types';
import { LoggedInUserResponse, UserResponse } from '../types';

export function getLoggedInUser() {
return axios.get(`/api/auth_user`)
.then((response: AxiosResponse<LoggedInUser>) => {
return response.data;
.then((response: AxiosResponse<LoggedInUserResponse>) => {
return response.data.user;
}).catch((error: AxiosError) => {
return {};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface User {
}
export type LoggedInUser = User & {};

export type LoggedInUserResponse = { user: LoggedInUser; msg: string; };
export type UserResponse = { user: User; msg: string; };

/* getLoggedInUser */
Expand Down

0 comments on commit 7c824f0

Please sign in to comment.