Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created March 5, 2018 21:51
Show Gist options
  • Save bobsilverberg/202c173e3138ec00b17597bfefbaa75f to your computer and use it in GitHub Desktop.
Save bobsilverberg/202c173e3138ec00b17597bfefbaa75f to your computer and use it in GitHub Desktop.
return callApi({
auth: true,
body: {
default_locale: defaultLocale,
description,
name,
slug,
// The public=true|false flag is not sent to the API. This is
// because collections are always public. Omitting this parameter
// should cut down on unexpected bugs.
},
endpoint: `accounts/account/${user}/collections/${collectionSlug || ''}`,
method: `${action === 'create' ? 'POST' : 'PATCH'}`,
state: api,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment