Commit 2f394319 authored by Andreas Heimann's avatar Andreas Heimann

added current version api call

parent a4ce8eca
......@@ -16,6 +16,7 @@ use App\Entity\Ad;
class APIController extends AbstractController
{
public $currentVersion = 1;
public $clientVersion = [1, 0, 0];
/**
* @Route("/api/ping", name="api.ping")
......@@ -25,6 +26,14 @@ class APIController extends AbstractController
return new JsonResponse(['version' => $this->currentVersion, 'status' => 200, 'pong' => true]);
}
/**
* @Route("/api/currentVersion", name="api.currentVersion")
*/
public function currentVersion()
{
return new JsonResponse(['version' => $this->currentVersion, 'status' => 200, 'data' => $this->clientVersion]);
}
/**
* @Route("/api/songs/new/{offset}", name="api.songs.new")
*/
......@@ -266,7 +275,7 @@ class APIController extends AbstractController
->setParameter('query', '%'.$searchQuery.'%')
->getQuery()
->getResult();
foreach($resultsSongs as $result) {
$oneResult = [];
......
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