Skip to content

Commit 31ef4fc

Browse files
committed
REMOVE: array nesting from match object
1 parent ac0cb74 commit 31ef4fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ app.get('/recent', (req, res) => {
6161

6262
app.get('/:uuid', (req, res) => {
6363
loadDatabase((allItems) => {
64-
const matches = searchDatabase(req.params, allItems);
65-
if (matches.length === 0) {
64+
const match = searchDatabase(req.params, allItems)[0];
65+
if (match.length === 0) {
6666
logScanned(req.params.uuid);
6767
res.status(404).render('notFound', {
6868
item: '',
6969
id: req.params.uuid,
7070
});
7171
return;
7272
}
73-
addMarkdown(matches[0]);
74-
addSimilarItems(matches[0], allItems);
75-
logScanned(req.params.uuid, matches[0].fixture);
76-
res.render('item', matches[0]);
73+
addMarkdown(match);
74+
addSimilarItems(match, allItems);
75+
logScanned(req.params.uuid, match.fixture);
76+
res.render('item', match);
7777
});
7878
});
7979

0 commit comments

Comments
 (0)