Skip to content

Commit

Permalink
fix: move address group hook onto group
Browse files Browse the repository at this point in the history
  • Loading branch information
peterferguson committed Apr 4, 2024
1 parent 5df30b9 commit 3da9d44
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 } }) => {
Expand Down

0 comments on commit 3da9d44

Please sign in to comment.