Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
5a36fd40
Unverified
Commit
5a36fd40
authored
May 08, 2019
by
Tamika Tannis
Committed by
GitHub
May 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error in handling the logged in user response (#142)
parent
97597e21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
v0.ts
amundsen_application/static/js/ducks/user/api/v0.ts
+3
-3
types.ts
amundsen_application/static/js/ducks/user/types.ts
+1
-0
No files found.
amundsen_application/static/js/ducks/user/api/v0.ts
View file @
5a36fd40
import
axios
,
{
AxiosResponse
,
AxiosError
}
from
'axios'
;
import
{
LoggedInUser
,
UserResponse
}
from
'../types'
;
import
{
LoggedInUser
Response
,
UserResponse
}
from
'../types'
;
export
function
getLoggedInUser
()
{
return
axios
.
get
(
`/api/auth_user`
)
.
then
((
response
:
AxiosResponse
<
LoggedInUser
>
)
=>
{
return
response
.
data
;
.
then
((
response
:
AxiosResponse
<
LoggedInUser
Response
>
)
=>
{
return
response
.
data
.
user
;
}).
catch
((
error
:
AxiosError
)
=>
{
return
{};
});
...
...
amundsen_application/static/js/ducks/user/types.ts
View file @
5a36fd40
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment