Skip to content

Commit

Permalink
fix(home) displaying users favorites...
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmrval committed Jun 19, 2024
1 parent 9801bc9 commit ee12ab5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions components/homepage/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ function getStopName($stopId) {

return reset($result)['fields']['nom_zda'];
}

function getFavorites($lineId) {
global $conn;
try {
$query = $conn->prepare("SELECT stopId FROM favorites WHERE lineId = ?");
$query->execute([$lineId]);
$query = $conn->prepare("SELECT stopId FROM favorites WHERE lineId = ? AND userId = ?");
$query->execute([$lineId, $_SESSION['user_id']]);
$result = $query->fetchAll(PDO::FETCH_ASSOC);

return $result;
Expand Down
2 changes: 1 addition & 1 deletion data/stops.json

Large diffs are not rendered by default.

0 comments on commit ee12ab5

Please sign in to comment.