Skip to content

Commit

Permalink
Merge pull request #14 from BaptisteBuvron/api_fix
Browse files Browse the repository at this point in the history
Fix: api filter and closed </ul> header
  • Loading branch information
BaptisteBuvron authored Jun 15, 2023
2 parents 7e81206 + 9d47aa1 commit 43ccc0b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
5 changes: 4 additions & 1 deletion app/controllers/ApiController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export class ApiController {
//get filters from request
let minSalary = req.query.salary;
let region = req.query.region;
let filterOffer = new FilterOffer(Number(minSalary), region ? String(region) : undefined);
let filterOffer;
if (minSalary || region) {
filterOffer = new FilterOffer(Number(minSalary), region ? String(region) : undefined);
}
OfferRepository.getAll(filterOffer).then((offers: OffreDePoste[]) => {
res.json(offers);
});
Expand Down
19 changes: 10 additions & 9 deletions app/views/partials/adminHeader.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,25 @@
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link <%= (title == 'Home') ? 'active' :'' %>" aria-current="page" href="/admin">Accueil</a>
<a class="nav-link <%= (title == 'Home') ? 'active' : '' %>" aria-current="page" href="/admin">Accueil</a>
</li>
<li class="nav-item">
<a class="nav-link <%= (title == 'Utilisateurs') ? 'active' :'' %>" href="/admin/utilisateurs">Utilisateurs</a>
<a class="nav-link <%= (title == 'Utilisateurs') ? 'active' : '' %>" href="/admin/utilisateurs">Utilisateurs</a>
</li>
<li class="nav-item">
<a class="nav-link <%= (title == 'Demandes') ? 'active' :'' %>" href="/admin/demandes">Demandes</a>
<a class="nav-link <%= (title == 'Demandes') ? 'active' : '' %>" href="/admin/demandes">Demandes</a>
</li>
<li class="nav-item">
<a class="nav-link <%= (title == 'Offres') ? 'active' :'' %>" href="/admin/offres">Offres d'emploi</a>
<a class="nav-link <%= (title == 'Offres') ? 'active' : '' %>" href="/admin/offres">Offres
d'emploi</a>
</li>
</ul>
</div>
<ul class="navbar-nav mb-2 my-lg-0">
<% if(typeof user !== 'undefined' && user){ %>
<li class="m-2"><%= user.nom%> <%= user.prenom%> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% }%>
<ul>
</div>
<li class="m-2"><%= user.nom %> <%= user.prenom %> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% } %>
</ul>
</div>
</nav>
10 changes: 5 additions & 5 deletions app/views/partials/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
</li>
</ul>
<ul class="navbar-nav mb-2 my-lg-0">
<% if(typeof user !== 'undefined' && user){ %>
<li class="m-2"><%= user.nom%> <%= user.prenom%> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% }%>
<ul>
<% if(typeof user !== 'undefined' && user){ %>
<li class="m-2"><%= user.nom %> <%= user.prenom %> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% } %>
</ul>
</div>
</div>
</nav>
Expand Down
12 changes: 6 additions & 6 deletions app/views/partials/recruteurHeader.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
</li>
</ul>
<ul class="navbar-nav mb-2 my-lg-0">
<% if(typeof user !== 'undefined' && user){ %>
<li class="m-2"><%= user.nom%> <%= user.prenom%> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% }%>
<ul>
</div>
<% if(typeof user !== 'undefined' && user){ %>
<li class="m-2"><%= user.nom %> <%= user.prenom %> </li>
<a href="/logout" class="btn btn-primary">Déconnexion</a>
<% } %>
</ul>
</div>
</div>
</nav>

Expand Down

0 comments on commit 43ccc0b

Please sign in to comment.