holochain / clutter

Fully distributed twitter built on holochain
161 stars 22 forks source link

add getPost which accepts hash and returns post #23

Closed Connoropolous closed 6 years ago

Connoropolous commented 6 years ago

This is to go with this UI post that Robert Best, Haiz, and I built together in the react app https://github.com/Connoropolous/clutter/commit/2e74e9ff794dab5f757e487cd2c02716047c42cd

Connoropolous commented 6 years ago

Resolves #22

Connoropolous commented 6 years ago

I can add

On Dec 22, 2017 11:37 AM, "Eric Harris-Braun" notifications@github.com wrote:

@zippy requested changes on this pull request.

In dna/clutter/clutter.js https://github.com/Holochain/clutter/pull/23#discussion_r158521891:

@@ -58,6 +58,20 @@ function postMod(params) { return update("post",post,hash); }

+function getPost(params) {

Before merging this I'd love for this function to have a test added to tests/posts.json https://github.com/Holochain/clutter/blob/master/test/posts.json Would you like to add that, or should I?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Holochain/clutter/pull/23#pullrequestreview-85351892, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWAYcgBQHG9GZ2RBbwbtxAMmY0flTDtks5tC9rUgaJpZM4RKfxX .

Connoropolous commented 6 years ago

@zippy I added that test now :)

Connoropolous commented 6 years ago

I also changed the shape of the post response back to matching the other responses. I really don't like the shape of the response, but it's probably best just to have them all match then to have one that's different. I also returned the HC error if its not found, instead of undefined

zippy commented 6 years ago

I actually agree with you on the shape of the responses. I kinda just hacked it together. Happy to see it changed to something more rational... :-)