Skip to content

Instantly share code, notes, and snippets.

@owrrpon
Created June 5, 2021 15:40
Show Gist options
  • Save owrrpon/0ad7f0021838f6b48d746c6eebcc44e7 to your computer and use it in GitHub Desktop.
Save owrrpon/0ad7f0021838f6b48d746c6eebcc44e7 to your computer and use it in GitHub Desktop.
writing a service call in the service layer
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