Create Menu

Create a menu for an exisitng business.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new Menu for an exisitng business.

    • typestringRequired

      Provide Menu type. Current selection is only menus.

    • attributesformData, object

      Attributes object.

      • display_namestring

        Menu display name.

      • filefile

        Menu list of items.

    • relationshipsformData, object

      Relationships object with business object.

      • businessformData, object

        Add a relationships link between Menu and related Business.

        • idstring

          Related Business id.

        • typestring

          Business type; business.

POST/api/v1/menus

{
  const res = await fetch(`${BASE_URL}/api/v1/menus`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "1fc3d278-db04-4268-a1d1-6ab4a4b10032",
    "type": "menus",
    "links": {
      "self": "/menus/1fc3d278-db04-4268-a1d1-6ab4a4b10032"
    },
    "attributes": {
      "display-name": "Menu",
      "file": {
        "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/menu/file/1fc3d278-db04-4268-a1d1-6ab4a4b10032/7ba661e5-f32e-4b93-ae4d-ac4da09b21af.jpeg"
      }
    }
  }
}

Update Menu

Update a Menu.

Parameters
  • idpath integerRequired

    Update a Menu by specific id.

  • dataformData, objectRequired

    Form Data needed when updating a Menu.

    • idstringRequired

      Provide Menu id.

    • typestringRequired

      Provide Menu type. Current selection is only menus.

    • attributesformData, object

      Attributes object.

      • display_namestring

        Menu display name.

      • filefile

        Menu list of items.

PATCH/api/v1/menus/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/menus/${id}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "1fc3d278-db04-4268-a1d1-6ab4a4b10032",
    "type": "menus",
    "links": {
      "self": "/menus/1fc3d278-db04-4268-a1d1-6ab4a4b10032"
    },
    "attributes": {
      "display-name": "Menu name was edited here!",
      "file": {
        "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/menu/file/1fc3d278-db04-4268-a1d1-6ab4a4b10032/7ba661e5-f32e-4b93-ae4d-ac4da09b21af.jpeg"
      }
    }
  }
}

Delete Menu

Delete a Menu.

Parameters
  • idpath integerRequired

    Delete a Menu by specific id.

DELETE/api/v1/menus/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/menus/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}