Refactor `CommonAPI.post/2`
I was investigating the possibility to implement status editing. So I was thinking about how to adapt CommonAPI.post/2
for updates, and it seems very hard to change.
I figured maybe turn it into something ecto-like so it'd allow composing new posts as well as post updates, possibly with different types. What do you think?
Changes
- Move the logic from
CommonAPI.post/2
toCommonAPI.ActivityDraft
(not sure if it's a good name) - Split the logic to multiple pipeable functions
- Refactor
CommonAPI.Utils.make_poll_data/1
. Before validations were rising exceptions insidetry/rescue
, this MR replaces that withwith
statement. - Cleanup
CommonAPI