Game-Jaming/Backend/Controllers/Polls/GetVote.php

13 lines
351 B
PHP
Raw Normal View History

2021-03-11 12:21:16 +00:00
<?php
use Backend\Models\Vote;
2021-03-16 11:46:44 +00:00
require_once "../../../bootstrap.php";
2021-03-11 12:21:16 +00:00
require_once "../Group/Group.php";
if(isLogin()){
header('Content-Type: application/json;charset=UTF-8');
2021-03-22 14:29:18 +00:00
echo json_encode(array('data' => Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->jsonSerialize()));
2021-03-11 12:21:16 +00:00
2021-03-19 12:25:27 +00:00
}else{
2021-03-22 08:42:17 +00:00
echo http_response_code(401);
2021-03-11 12:21:16 +00:00
}