From 3da9d446f9cb2fd4bcd56f4d51d665052b6be5fc Mon Sep 17 00:00:00 2001 From: Peter Ferguson Date: Thu, 4 Apr 2024 11:18:32 +0100 Subject: [PATCH] fix: move address group hook onto group --- src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index f38c01e..1a47d49 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,10 +61,11 @@ export default new Elysia() }), ) .get("/", () => "Onit XMTP bot 🤖") - .group("/:address", (app) => { - return app.get( - "/", - async ({ params: { address } }) => { + .group( + "/:address", + { params: t.Object({ address: AddressLiteral }) }, + (app) => { + return app.get("/", async ({ params: { address } }) => { console.log("getting groups by address", address); // - get the addresses safes const safes = await getOwnersSafes(address); @@ -73,10 +74,9 @@ export default new Elysia() // - check for groups with the safe address return (await getGroupsByWalletAddresses(safes)) || []; - }, - { params: t.Object({ address: AddressLiteral }) }, - ); - }) + }); + }, + ) .group("/group/:groupId", (app) => { return app .get("/", async ({ params: { groupId } }) => {