Reportback items endpoint#5055
Conversation
|
@chloealee No need to worry about DoSomethingArchive/LetsDoThis-iOS#286 for this PR, thanks for checking! |
There was a problem hiding this comment.
was NORTSTAR_URL not working locally?
There was a problem hiding this comment.
the URL was sending me to qa instead of local where I wanted to test but looks good now so I'll change back!
There was a problem hiding this comment.
I actually changed this back - right now, the $base_url prints http://northstar.dev:8000 where as before, it printed http://northstar-qa.dosomething.org:8000. Is this ok?
|
I'm also worried about the cache actually working - is there a way to test this on staging? |
There was a problem hiding this comment.
that's from pulling from stage, you can reset that locally here
|
@chloealee as far as cache testing, you can see that in the |
There was a problem hiding this comment.
Not vital at all (or maybe just a future update to consider), but might be cleaner if you could save the nested array to $northstar_user and then cast it to an object:
$northstar_user = json_decode($northstar_user->data, true);
$northstar_user = (object) $northstar_user['data'][0];So then you can get each item similar to how code above retrieves it for consistency:
$this->user = [
'id' => $data->uid,
'first_name' => $northstar_user->first_name,
'last_name' => $northstar_user->last_name,
'photo' => $northstar_user->photo,
'country' => $northstar_user->country,
];Something like that... :)
There was a problem hiding this comment.
that looks a lot better, I'll update now, thanks Diego!
There was a problem hiding this comment.
💣 meh, looks like we don't need this?
There was a problem hiding this comment.
ah yes, sorry for being so sloppy and missing this! Removed.
|
👍 🚢 🍷 |
updates `/reportback-items` endpoint with user's `first_name`, `last_name`, `country`, and `photo`
|
Nice work @chloealee 💃 |
Fixes DoSomethingArchive/api#7
What's this PR do?
Adds a user's
first_name,last_name,country, andphototo thereportback-itemsendpoint. Makes the request from phoenix to ns to grab user data and caches this data for 24 hours.Where should the reviewer start?
phoenix -> northstar call is made in lines 132-148 of ReportbackController.
How should this be manually tested?
Comment in line 137 of ReportbackController.php to get a specific user's information.
User endpoint
dev.dosomething.org:8888/api/v1/reportback-items.jsonTo test caching is working correctly: http://drupal.stackexchange.com/questions/87184/how-to-check-that-cache-is-working-on-current-page
What are the relevant tickets?
Will this conflict @aaronschachter?
DoSomethingArchive/LetsDoThis-iOS#286