Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // pseudo code
  2.  
  3. // frontend payload
  4. payload = {
  5.     title: undefined,
  6.     externalId: 'newId',
  7. }
  8.  
  9. controller {
  10.     updateEndpoint = (body) => {
  11.         if (body.title && checkIfTitleExists()) {
  12.             badRequest()
  13.         }
  14.  
  15.         model = body
  16.  
  17.         model.save()
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement