Skip to content

Instantly share code, notes, and snippets.

@JakeDawkins
Last active October 29, 2019 23:48
Show Gist options
  • Select an option

  • Save JakeDawkins/87f7f91547446cc92a931e8e88cb8dee to your computer and use it in GitHub Desktop.

Select an option

Save JakeDawkins/87f7f91547446cc92a931e8e88cb8dee to your computer and use it in GitHub Desktop.
getAll: () => {
if(!user || !user.roles.includes('admin')) return null;
return fetch('http://myurl.com/users');
}
@jpdenford
Copy link

Great article thank you.
A small correction for this snippet, I think it is missing a closing paren. after 'admin')

if(!user || !user.roles.includes('admin')) return null;

@JakeDawkins
Copy link
Author

@jpdenford great catch, thank you! I've updated it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment