tangled
alpha
login
or
join now
thevoid.cafe
/
voidy
0
fork
atom
A powerful and extendable Discord bot, with it's own module system :3
thevoid.cafe/projects/voidy
0
fork
atom
overview
issues
pulls
pipelines
✨ Make GET /items return all items by default
Jo
2 months ago
7f65dcfe
e36a0847
+3
-1
1 changed file
expand all
collapse all
unified
split
packages
api
routes
api
v1
shop.ts
+3
-1
packages/api/routes/api/v1/shop.ts
···
17
17
shop.get("/items", async (c) => {
18
18
const item = c.req.query("item");
19
19
20
20
+
// Return all items if no item is specified
20
21
if (!item) {
21
21
-
return c.json({ error: "Item query parameter is required" }, 400);
22
22
+
const locatedItems = await MinecraftShopItem.find();
23
23
+
return c.json(locatedItems);
22
24
}
23
25
24
26
const locatedItem = await MinecraftShopItem.findOne({ item });