Merge pull request #226 from hammerdawn/APICHANGE
Allow listing a user by both ID and email. Useful for checking if a u…
This commit is contained in:
commit
39731f99da
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ class UserController extends BaseController
|
||||||
*/
|
*/
|
||||||
public function view(Request $request, $id)
|
public function view(Request $request, $id)
|
||||||
{
|
{
|
||||||
$query = Models\User::where('id', $id);
|
$query = Models\User::where((is_numeric($id) ? 'id' : 'email'), $id);
|
||||||
|
|
||||||
if (! is_null($request->input('fields'))) {
|
if (! is_null($request->input('fields'))) {
|
||||||
foreach (explode(',', $request->input('fields')) as $field) {
|
foreach (explode(',', $request->input('fields')) as $field) {
|
||||||
|
|
Loading…
Reference in a new issue