Create Favourites

Add given business to current user favourites.

Parameters
  • dataformData, objectRequired

    Form Data needed when adding given supplier to current businesses favourites.

    • typestringRequired

      Provide Favourite Suppliers type. Current selection is only favorites.

    • relationshipsformData, objectRequired

      Relationships object with business object.

      • businessformData, objectRequired

        Add a relationships link between Favourites and related Business.

        • idstringRequired

          Related Business id.

        • typestringRequired

          Business type; business.

POST/api/v1/favorites

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

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "7fa8d859-0624-4a48-85f5-3afab88a11a7",
    "type": "favorites",
    "links": {
      "self": "/favorites/7fa8d859-0624-4a48-85f5-3afab88a11a7"
    }
  }
}

Delete Favourite

Delete a Favourite.

Parameters
  • idpath integerRequired

    Delete a Favourite by specific id.

DELETE/api/v1/favorites/{id}

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