Skip to content

Commit 53e07c2

Browse files
fix: adjusting ACCOUNT_URL to use production.config
Signed-off-by: Samuelson Brito <[email protected]>
1 parent e1696d6 commit 53e07c2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

config.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@
317317
return 'posts/' . $page->slug;
318318
},
319319
'items' => function ($post) {
320-
if(isset($_ENV['ACCOUNT_URL'])){
320+
if(empty($post->get('accountUrl'))){
321321
return [];
322322
}
323-
$categories = json_decode(file_get_contents($_ENV['ACCOUNT_URL'] . '/wp-json/wp/v2/categories'));
323+
$categories = json_decode(file_get_contents($post->get('accountUrl') . '/wp-json/wp/v2/categories'));
324324
$categories = array_filter($categories, fn ($c) => $c->slug === 'article');
325325
$posts = [];
326326
foreach ($categories as $category) {
327-
$baseUrl = $_ENV['ACCOUNT_URL'] . '/wp-json/wp/v2/posts?_embed&categories=' . $category->id . '&lang=' . $category->lang;
327+
$baseUrl = $post->get('accountUrl') . '/wp-json/wp/v2/posts?_embed&categories=' . $category->id . '&lang=' . $category->lang;
328328
$headers = get_headers($baseUrl);
329329
$totalPages = 1;
330330
foreach ($headers as $header) {
@@ -344,7 +344,7 @@
344344
};
345345
}
346346

347-
$wordPressLanguages = json_decode(file_get_contents($_ENV['ACCOUNT_URL'] . '/wp-json/pll/v1/languages'));
347+
$wordPressLanguages = json_decode(file_get_contents($post->get('accountUrl') . '/wp-json/pll/v1/languages'));
348348
return collect($posts)->map(function ($fromApi) use ($wordPressLanguages, $post) {
349349
$currentLang = current(array_filter($wordPressLanguages, fn ($l) => $l->slug === $fromApi['lang']));
350350
$data = [

config.production.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return [
44
'production' => true,
55
'matomo_container' => '8jNjdh8C',
6-
'accountUrl' => 'https://account.libresign.coop',
6+
'accountUrl' => getenv('ACCOUNT_URL'),
77
'form_url' => 'https://contactform.libresign.coop/validate.php',
88
'url_captcha' => 'https://contactform.libresign.coop/captcha.php',
99
'url_captcha_audio' => 'https://contactform.libresign.coop/audio_captcha.php',

0 commit comments

Comments
 (0)