Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Update restaurant tags

Add or remove tag from restaurants

[
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 7,
        "title_th": "จีน",
        "title_en": "Chinese",
        "category": "Cuisine",
        "synonyms": [
          "Tiongkok",
          "China"
        ]
      },
      "actions": {
        "add": [
          34
        ],
        "remove": [
          1136,
          1353
        ]
      }
    }
  }
]

Handle empty actions

If there is no actions, throw an error

[
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 7,
        "title_th": "จีน",
        "title_en": "Chinese",
        "category": "Cuisine",
        "synonyms": [
          "Tiongkok",
          "China"
        ]
      },
      "actions": {
        "add": [],
        "remove": []
      }
    }
  },
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 34,
        "city_id": null,
        "title_th": "แม็กซิกัน",
        "title_en": "Mexican",
        "category": "Cuisine",
        "synonyms": []
      }
    }
  }
]

Add tags to restaurants

[
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 7,
        "title_th": "จีน",
        "title_en": "Chinese",
        "category": "Cuisine",
        "synonyms": [
          "Tiongkok",
          "China"
        ]
      },
      "actions": {
        "add": [
          1
        ]
      }
    }
  },
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 8,
        "title_th": "อิตาเลียน",
        "title_en": "Italian",
        "category": "Cuisine",
        "synonyms": []
      },
      "actions": {
        "add": [
          1
        ]
      }
    }
  },
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 9,
        "title_th": "ฝรั่งเศส",
        "title_en": "French",
        "category": "Cuisine",
        "synonyms": []
      },
      "actions": {
        "add": [
          1
        ]
      }
    }
  },
  {
    "op": "update",
    "payload": {
      "tag": {
        "id": 10,
        "title_th": "นานาชาติ",
        "title_en": "International",
        "category": "Cuisine",
        "synonyms": [
          "Global"
        ]
      },
      "actions": {
        "add": [
          1
        ]
      }
    }
  }
]