Skip to content

Instantly share code, notes, and snippets.

@emmsdan
Created April 12, 2019 12:19
Show Gist options
  • Select an option

  • Save emmsdan/7f83142b9d1c6ca8b12d3b68de72bbea to your computer and use it in GitHub Desktop.

Select an option

Save emmsdan/7f83142b9d1c6ca8b12d3b68de72bbea to your computer and use it in GitHub Desktop.
updateArticle (req, res);
updateArticle =>
const { tags, title, description, body, images } = res.body;
const updatedArticle = Articles.update(
{ tags, title, description, body, images },
{ where: { id: 'sdfw3edcs-dc-xwedsvc-ew' } });
const tagUpdate = updateTags(tags, updatedArticle.id);
if (tagUpdate.status === 'error') return errorResponse(tagUpdate.message);
if (updateArticle < 0){
return errorResponse('msakdnfnas');
}
return sucessResposne();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment