Skip to content

Commit

Permalink
debug /events path
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Sep 17, 2024
1 parent c9c0d96 commit 87e52ad
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,19 @@
</main>
<!-- End of Main Content -->
<?php
if ($apiVersion === 'dev') {
$eventsEndpoint = "https://litcal.johnromanodorazio.com/api/dev/events/";
if ($apiVersion === 'dev' || $apiVersion === 'v4') {
$eventsEndpoint = "https://litcal.johnromanodorazio.com/api/dev/events";
$eventsRaw = file_get_contents("$eventsEndpoint?locale=" . $i18n->locale);
if ($eventsRaw === false) {
die('Could not fetch data from ' . $eventsEndpoint);
}
[ "litcal_events" => $LitCalAllFestivities ] = json_decode(
file_get_contents("$eventsEndpoint?locale=" . $i18n->locale),
$eventsRaw,
true
);
if (JSON_ERROR_NONE !== json_last_error()) {
die('Could not parse JSON from ' . $eventsEndpoint . ' : ' . json_last_error_msg());
}
}
include_once 'components/NewTestModal.php';
?>
Expand Down Expand Up @@ -174,7 +181,6 @@ class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2" viewBox="0 0 16 16"
<div id="responseMessage"></div>
</div>
<?php
$LitEventKeys = json_encode($LitCalAllFestivities);
echo "<script>const LitCalTests = Object.freeze($response); let LitCalAllFestivities = Object.freeze($LitEventKeys);</script>";
echo "<script>const LitCalTests = Object.freeze($response); let LitCalAllFestivities = Object.freeze($eventsRaw);</script>";
include_once 'layout/footer.php';
?>

0 comments on commit 87e52ad

Please sign in to comment.