Skip to content

Instantly share code, notes, and snippets.

@kluu1
Last active March 16, 2020 14:21
Show Gist options
  • Select an option

  • Save kluu1/2b1f8dbb59b1e7562ea7fd59b1f5b704 to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/2b1f8dbb59b1e7562ea7fd59b1f5b704 to your computer and use it in GitHub Desktop.
import request from 'superagent';
...
const getCustomer = async (id) => {
try {
const response = await request
.get(`${process.env.CUSTOMERS_ENDPOINT}/customer/${id}`)
.set('Authorization', this.$store.state.idToken)
this.customers = response.body.userProfiles;
this.page = response.body.currentPage;
this.maxPages = response.body.totalPages;
} catch (error) {
this.$config.showError(error);
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment