Commit ec3b845d authored by Open Source Developer's avatar Open Source Developer

tran

parent 5a270a91
......@@ -34,9 +34,22 @@ class SubmitedApplications extends ControllerBase
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if ($epalUser) {
$userid => $epalUser -> user_id -> entity ->id();
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('user_id' => $userid));
$epalStudent = reset($epalStudents);
if ($epalStudent) {
return $this->respondWithStatus([
'id' => $epalUser->entity->id(),
'name' => $epalStudent ->name->value,
'studentsurname' => $epalStudent ->studentsurname->value,
], Response::HTTP_OK);
}
else {
return $this->respondWithStatus([
'message' => t("EPAL user not found"),
], Response::HTTP_FORBIDDEN);
}
} else {
return $this->respondWithStatus([
'message' => t("EPAL user not found"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment