hoodiehq / hoodie-account-client

:dog: Account client API for the browser
https://hoodiehq.github.io/hoodie-account-client
Apache License 2.0
11 stars 24 forks source link

Proof of concept for account profiles. #98

Open jameswestnz opened 8 years ago

jameswestnz commented 8 years ago

Some notes on this PR:

To do:

More than happy for someone to add to this PR ;)

closes https://github.com/hoodiehq/hoodie-account-client/issues/11

gr2m commented 8 years ago

I have assumed that profiles will be a permanent part of all account requests. I.e. this information is always included in get requests.

No I wouldn’t do that. I’d agree with account.signUp, but for account.signIn I’d suggest to add an include argument which can be set to profile to include it in the response.

I think the account.profile methods should be fine. Only thing missing in your TODOs is updating docs

gr2m commented 8 years ago

can you add a test to hoodie-account-server/tests/integration/routes/account/put-account-test.js with payload.data.attributes.profile set to something like fullname: 'Pat Doe'? Ideally to post-accounts-test.js, too. It would be great to test that at the end the _users doc will have profile.fullname set to Pat Doe

gr2m commented 8 years ago

I’d maybe add another integration test: sign-up-with-profile-test.js to make sure the behavior works and won’t break in future. Otherwise looking good 👍

jameswestnz commented 8 years ago

@gr2m have added (server) a test here: https://github.com/hoodiehq/hoodie-account-server/pull/158/commits/f69ffa927cdea65d36b7ed2e721245dcc7d9974f

Keen on feedback before I do the PATCH test just in case :)