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