Skip to content

Instantly share code, notes, and snippets.

@dustinc
Last active May 30, 2018 20:56
Show Gist options
  • Save dustinc/9a2ff3094258fb63cb8149d2183ed325 to your computer and use it in GitHub Desktop.
Save dustinc/9a2ff3094258fb63cb8149d2183ed325 to your computer and use it in GitHub Desktop.

@kyleeddins2 @chadsaxon

New endpoints:

  • /post/requests/pending - List ALL pending booking requests. To only send back booking requests I added a post field to the booking request object to help format approval url.
  • /post/:id/requests/pending - List pending booking requests for post of :id.
  • /post/:id/requests/:request_id/approve - Approve a booking request.
  • /settings[/:id] - CRUD operation on Settings resource. Format:
{
  key: String,
  values: Object of key => value pairs
}

Dev server is front-loaded with a single Setting entry as follows:

{
  "_id":"5b0f0139e7f4b73de35dacd5",
  "key":"admin_settings",
  "values": {
    "require_sitter_request_approval":true
   }
}

So to toggle this setting on/off: PUT /settings/5b0f0139e7f4b73de35dacd5 with body of { "values": { "require_sitter_request_approval": true | false } }

You should have access to the setting id just like you would say a post id once you call on the resources. I could open up an updateByKey endpoint if that would expedite things.

This is really only setup for that single setting right now as far as checks throughout app, obviously, but is structured so we can very easily add/manipulate settings going forward.`

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