const fetchToken = (uuid: any) => {
console.log(uuid);
AccountAPI.getAuthToken(uuid)
.then(() => dispatch({ type: RequestActionTypes.GET_TOKEN_SUCCESS }))
.catch(e => dispatch(
{
type: RequestActionTypes.GET_TOKEN_ERROR,
payload: e,
}));
};
dispatch({ type: RequestActionTypes.GET_TOKEN_START });
const uuid = localStorage.getItem('uuid');
if (uuid) {
dispatch({ type: RequestActionTypes.UUID_ALREADY_EXISTS });
fetchToken(uuid);
} else {
localStorage.setItem('uuid', generateUUID);
const newUuid = localStorage.getItem('uuid');
fetchToken(newUuid);
}
<div class="viewing-detailed-output">
<?php
$select_value = trim($_POST['select_value']);
$query = $pdo->query('SELECT * FROM `telephone` WHERE `fullname` = $select_value ');
$answer = [];
while($row = $query->fetch(PDO::FETCH_OBJ)) {
$answer = [$select_value => $row->name];
}
echo json_encode($answer);
?>
</div>