🎨 Added correct json struct to API responses

This commit is contained in:
Florian Sylvain
2021-10-31 15:59:53 +01:00
parent b4b3132ae7
commit 14c3839803
2 changed files with 35 additions and 31 deletions
+5 -2
View File
@@ -21,6 +21,9 @@ $json_object = match ($q) {
default => NULL,
};
// TODO : Rajouter la structure status message data
$json = json_encode($json_object);
$json = json_encode(array(
"status" => 200,
"message" => "Results : " . count($json_object), "data" => $json_object
),JSON_PRETTY_PRINT);
print_r($json);