Fix body object
This commit is contained in:
parent
ac0fc37bfd
commit
6e5500e565
|
@ -8,13 +8,13 @@ function init() {
|
|||
|
||||
function get_voting_ids($cfg) {
|
||||
$body = json_decode(file_get_contents('php://input'));
|
||||
$event_id = get_event_id($cfg, $body["event_token"]);
|
||||
$vote_round = $body["round"];
|
||||
$event_id = get_event_id($cfg, $body->event_token);
|
||||
$vote_round = $body->round;
|
||||
$result = [];
|
||||
if (!$event_id) {
|
||||
return ["error" => "event not found"];
|
||||
}
|
||||
foreach($body["user_names"] as $name) {
|
||||
foreach($body->user_names as $name) {
|
||||
$hash = get_hash($cfg, $event_id, $vote_round, $name);
|
||||
$result[] = ["round" => $vote_round, "user_name" => $name, "hash" => $hash];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue