mirror of
https://github.com/Floriansylvain/projet_programmation_web.git
synced 2026-10-19 04:53:51 +02:00
🎨 Added correct json struct to API responses
This commit is contained in:
1 parent
b4b3132ae7
commit
14c3839803
2 files changed
+35
-31
No files matched your search
@@ -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);
|
||||
Reference in new issue
Block a user