From 76d13366c26715d2cc9d2b2a95bbb1edb769c004 Mon Sep 17 00:00:00 2001 From: bootunloader Date: Sun, 22 Sep 2024 13:24:16 +0300 Subject: [PATCH] enabled yet again --- src/lib/trpc/routers/postdata.router.ts | 65 ++++++++++++------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/lib/trpc/routers/postdata.router.ts b/src/lib/trpc/routers/postdata.router.ts index bde9dfe..c542a79 100644 --- a/src/lib/trpc/routers/postdata.router.ts +++ b/src/lib/trpc/routers/postdata.router.ts @@ -188,48 +188,47 @@ export const postDataApiRouter = createTRPCRouter({ console.log(`[+] Posting ${data.length} entries to the API`); - await removePostSession(); return { ok: true, - detail: "Data posted successfully", - errors: undefined, + data: [], + users: [], }; - const res = await postDataToApi({ - sessions: userSessions, - data, - users: users, - draw: draw, - }); - console.timeEnd("Time taken to post data to the API"); + // const res = await postDataToApi({ + // sessions: userSessions, + // data, + // users, + // draw, + // }); + // console.timeEnd("Time taken to post data to the API"); - if (!res.ok) { - await removePostSession(); - return { ok: false, detail: res.detail }; - } + // if (!res.ok) { + // await removePostSession(); + // return { ok: false, detail: res.detail }; + // } - console.log(`[+] Data posted to the API successfully`); + // console.log(`[+] Data posted to the API successfully`); - await dbApiPostData.upsertData({ - id: getULID(), - drawId: +drawId.split(":")[1], - bookDate: date, - data, - createdAt: new Date().toISOString(), - updatedAt: new Date().toISOString(), - }); + // await dbApiPostData.upsertData({ + // id: getULID(), + // drawId: +drawId.split(":")[1], + // bookDate: date, + // data, + // createdAt: new Date().toISOString(), + // updatedAt: new Date().toISOString(), + // }); - // Update the balance of the users after posting to the API - await updateBalanceOfPostUsers(users); + // // Update the balance of the users after posting to the API + // await updateBalanceOfPostUsers(users); - console.log("[+] Data saved to the database"); + // console.log("[+] Data saved to the database"); - await postDataCacheStore.del(input.cachedDataKey); - await removePostSession(); - return { - ok: true, - detail: "Data successfully posted to API", - errors: undefined, - }; + // await postDataCacheStore.del(input.cachedDataKey); + // await removePostSession(); + // return { + // ok: true, + // detail: "Data successfully posted to API", + // errors: undefined, + // }; }), });