Skip to content

Commit

Permalink
+ Methodology Update
Browse files Browse the repository at this point in the history
  • Loading branch information
James-jamames committed Oct 23, 2023
1 parent 0563901 commit 30ed052
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/app/Models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class Article extends Model
'description',
'authors',
'image',
'url',
'file_pt',
'file_en',
];

public static function getTranslate(string $lang)
Expand Down
11 changes: 10 additions & 1 deletion server/app/Models/Methodology.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ public static function getTranslate(string $lang)
$methodology[$translation->column_name] = $translation->value;
}

unset($methodology->translations);
if($lang == "en")
{
$methodology["file"] = $methodology->file_en;
}
else
{
$methodology["file"] = $methodology->file_pt;
}

unset($methodology->translations, $methodology->file_pt, $methodology->file_en);
}

return $methodologies;
Expand Down

0 comments on commit 30ed052

Please sign in to comment.