So what you can do to cut down on this is have two variables: addLike and deleteLike (or something that sounds better / easier to understand).
So you're if would look like this:
`
var addLike;
var deleteLike;
if (liked) {
  addLike = 'Likes'
  deleteLike = 'Dislikes'
} else {
  addLike = 'Dislikes';
  deleteLike = 'Likes';
}

// Then do your get and update stuff here only once using the vars
`