EndlessVanguard / bitcoin-remunerate-api

A scheme for trustless, decentralized, anonymous, remuneration for content creators.
1 stars 0 forks source link

Content routes #31

Closed mattgstevens closed 8 years ago

mattgstevens commented 8 years ago

POST /content to upload new content to Momona

fromheten commented 8 years ago

Made a commit where the validations returning bools and returning strings are separated into different functions. Now the functions returning error messages returns an Array of strings, so when users upload bad data they will get all errors at once, without having to fix one error and then retry to find their next error.

Also made some small fixes for incorrect validations and removed unused params from functions.

fromheten commented 8 years ago

Let's not merge just yet - have some tests and documentation I wanna write

fromheten commented 8 years ago

Just pushing my final changes in the branch we have been working on. I made a proposal of how the isValid module can work with many errors. So now, if someone submits a record containing erroneous contentId AND price, they will get 2 (or more) error messages.

Also, this version does not throw, instead always returns lists of strings. I wanted to do so because throwing is a side effect. It can be useful to combine with promise-flow, but it also means it can not be ran twice without dealing with the side effect.

Updated the README with curl instructions for how to publish a new content. That feature works totally on my machine.

If you are happy with the code let me know, and let me know errors I made. Much code has changed, but works pretty similarly.

fromheten commented 8 years ago

So, now I think all your concerns have been fixed. A lot of great improvements :)