Add getUser API endpoint
This commit is contained in:
parent
e2d3fc3cee
commit
b844041ea9
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
if(!isset($_GET['login'])) {
|
||||
$data = [
|
||||
'error' => true,
|
||||
'message' => 'Не передано поле login',
|
||||
];
|
||||
}
|
||||
elseif(!$user = User::get($_GET['login'])) {
|
||||
$data = [
|
||||
'error' => true,
|
||||
'message' => 'Пользователь не существует',
|
||||
];
|
||||
}
|
||||
else {
|
||||
$data = [
|
||||
'error' => false,
|
||||
'data' => $user,
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue