WiiLink24 / food-server

A server designed to run the Demae channel.
MIT License
28 stars 12 forks source link

Determine how options should be listed on items #18

Closed spotlightishere closed 2 years ago

spotlightishere commented 2 years ago

When selecting a single item, options should be available, but how to construct them is currently unknown. We'll need to figure this out.

spotlightishere commented 2 years ago

It was determined that this was due to selList not being properly specified - the children id and name within values must be in their own parent node together. (This was resolved in 8551811cfdc3f681e20d7cb417eda92b64965a0e.)

For example, to have two options, one would need to do the following with our current setup:

"selList": {
  "values": {
      "first_option": {
          "id": 1,
          "name": "First Option",
      },
      "second_option": {
          "id": 2,
          "name": "Second Option",
      }
  }
}

One can also utilize RepeatedElement - the name of the parent node around id/name is ignored.

The resulting UI should match this:

Screenshot 2022-08-17 at 16 40 46

The channel will query with action type webApi_basket_list to denote adding an item. The value of selList will be only be set as a query parameter upon the second call.