zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

Allow choosing which fields are editted with `editMarket(...)`

Open sea212 opened this issue 2 years ago • 1 comments

When someone wants to edit a market, they currently have to specify every field again:

https://github.com/zeitgeistpm/zeitgeist/blob/c2c7ce9e73b63c812e1f5bb96be23cfb2d09728c/zrml/prediction-markets/src/lib.rs#L837-L869

However, most of the time only some details have to be changed, most likely the metadata and potentially the market_type to correct the number of outcomes or a scalar range. I propose to make every field except the market_id an Optional, thus not forcing the editor to edit fields he does not want to change. One could argue that the frontend has all the data and just inserts it, however we should not rely on assumptions about the entity that utilizes the functionality. The asset-registry in ORML can serve as an example for this.

cc @maltekliemann

sea212 avatar Feb 20 '23 11:02 sea212

One could argue that the frontend has all the data and just inserts it, however we should not rely on assumptions about the entity that utilizes the functionality.

This was originally the plan. The frontend will populate the form with the old data and then the user can make changes and send the edit. This is probably easiest for the frontend. But I see the point about not making that assumption. As long as this remains a low priority, I'm totally on board.

maltekliemann avatar Feb 20 '23 11:02 maltekliemann