Created
June 5, 2021 15:40
-
-
Save owrrpon/0ad7f0021838f6b48d746c6eebcc44e7 to your computer and use it in GitHub Desktop.
writing a service call in the service layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
login(user_credentials: any){ | |
let credentials = {...user_credentials}; | |
return this.serviceWrapper( | |
'POST', | |
this.getAPI('login'), | |
(response: any) => { | |
if(response.responseCode == 200){ | |
return {'data': response}; | |
}else{ | |
return {'error': response}; | |
} | |
}, | |
{ | |
body: credentials | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment