Skip to content

Instantly share code, notes, and snippets.

@brybrophy
Last active October 26, 2017 20:35
Show Gist options
  • Save brybrophy/e6d8eddca2cd5923b9137c4d9bfa4ec1 to your computer and use it in GitHub Desktop.
Save brybrophy/e6d8eddca2cd5923b9137c4d9bfa4ec1 to your computer and use it in GitHub Desktop.
import baseApi from './api';
import { displayUserFeedback } from './utils';
export async function handleClickGetAllUsers() {
try {
return await baseApi.users.getAll();
} catch () {
displayUserFeedback('There was an error retrieving the users.');
}
}
export async function handleClickGetOneUser(userId) {
try {
return await baseApi.users.getOne(userId);
} catch () {
displayUserFeedback('There was an error retrieving the users.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment