implement search
This commit is contained in:
parent
d4b357ab20
commit
c3554afde9
@ -50,7 +50,7 @@ class Web {
|
||||
|
||||
app.get('/', async (req, res) => {
|
||||
try {
|
||||
const builds = await this.db.getBuildsBy(req.query);
|
||||
const builds = 'q' in req.query ? await this.db.searchBuilds(req.query.q as string) : await this.db.getBuildsBy(req.query);
|
||||
res.render('index', {
|
||||
page: {
|
||||
title: 'Archery',
|
||||
|
@ -3,7 +3,7 @@
|
||||
<a href="/"><img src="/assets/svg/archy.svg" alt="Archery icon" /></a>
|
||||
</div>
|
||||
<div class="sidebar_search">
|
||||
<form action="/search" method="get">
|
||||
<form action="/" method="get">
|
||||
<input type="text" name="q" placeholder="Search..." />
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user