diff --git a/apps/site/app/api/post/route.ts b/apps/site/app/api/post/route.ts index af50bed9..404a2fe6 100644 --- a/apps/site/app/api/post/route.ts +++ b/apps/site/app/api/post/route.ts @@ -11,22 +11,10 @@ export const maxDuration = 30 // This function can run for a maximum of 30 secon export async function POST(req: NextRequest) { const post = await req.json() - if (!syndicateClientPost) { - return new Response( - JSON.stringify({ - success: false, - hash: null, - error: 'Syndicate client not initialized', - }), - { - status: 500, - headers: { 'Content-Type': 'application/json' }, - }, - ) - } try { const postTx = - await syndicateClientPost.officialActions.transact.sendTransaction( + // biome-ignore lint: + await syndicateClientPost!.officialActions.transact.sendTransaction( generatePostTxnInput(post), ) diff --git a/apps/site/app/api/postBatch/route.ts b/apps/site/app/api/postBatch/route.ts index e606698e..2ad30a0d 100644 --- a/apps/site/app/api/postBatch/route.ts +++ b/apps/site/app/api/postBatch/route.ts @@ -9,23 +9,10 @@ import { waitForHash } from '@syndicateio/syndicate-node/utils' export async function POST(req: NextRequest) { const postsArray = await req.json() - if (!syndicateClientPost) { - return new Response( - JSON.stringify({ - success: false, - hash: null, - error: 'Syndicate client not initialized', - }), - { - status: 500, - headers: { 'Content-Type': 'application/json' }, - }, - ) - } - try { const postTx = - await syndicateClientPost.officialActions.transact.sendTransaction( + // biome-ignore lint: + await syndicateClientPost!.officialActions.transact.sendTransaction( generatePostBatchTxnInput(postsArray), ) diff --git a/apps/site/app/api/registerFor/route.ts b/apps/site/app/api/registerFor/route.ts index 6c130577..ac4508ea 100644 --- a/apps/site/app/api/registerFor/route.ts +++ b/apps/site/app/api/registerFor/route.ts @@ -13,30 +13,13 @@ export const maxDuration = 30 // This function can run for a maximum of 30 secon export async function POST(req: NextRequest) { const user = await req.json() - console.log({ user }) - const { username, ...userWithoutUsername } = user const { to, recovery, deadline, sig } = userWithoutUsername - console.log({ userWithoutUsername }) - - if (!syndicateClientIdRegistry) { - return new Response( - JSON.stringify({ - success: false, - hash: null, - error: 'Syndicate client not initialized', - }), - { - status: 500, - headers: { 'Content-Type': 'application/json' }, - }, - ) - } - try { const registerTx = - await syndicateClientIdRegistry.officialActions.transact.sendTransaction( + // biome-ignore lint: + await syndicateClientIdRegistry!.officialActions.transact.sendTransaction( generateIdRegistryInput({ to, recovery, deadline, sig }), ) @@ -45,8 +28,6 @@ export async function POST(req: NextRequest) { transactionId: registerTx.transactionId, }) - console.log({ successfulTxHash }) - const txnReceipt = await optimismPubClient.waitForTransactionReceipt({ hash: successfulTxHash as Hex, }) @@ -60,9 +41,6 @@ export async function POST(req: NextRequest) { txnReceipt.logs[0].data, ) - console.log('rid: ', rid) - console.log('transaction receipt: ', successfulTxHash) - return new Response( JSON.stringify({ success: true, diff --git a/apps/site/biome.json b/apps/site/biome.json index 9a95a48f..bc66ade3 100644 --- a/apps/site/biome.json +++ b/apps/site/biome.json @@ -15,7 +15,9 @@ "rules": { "recommended": true, "style": { - "noUselessElse": "off" + "noUselessElse": "off", + "noNonNullAssertion":"off" + }, "suspicious": { "noRedeclare": "off",