This commit is contained in:
bootunloader
2024-09-22 13:32:58 +03:00
parent 839f69a44b
commit d030a8063c

View File

@@ -131,7 +131,13 @@ export const postDataApiRouter = createTRPCRouter({
const balOut = await updateBalanceOfPostUsers(users); const balOut = await updateBalanceOfPostUsers(users);
if (!balOut.ok || !balOut.data) { if (!balOut.ok || !balOut.data) {
await removePostSession(); await removePostSession();
return { ok: false, detail: balOut.detail, data: [], users: [] }; return {
ok: false,
detail: balOut.detail,
data: [],
users: [],
errors: [],
};
} }
console.log(`[=] ${users} users found`); console.log(`[=] ${users} users found`);
console.log(users); console.log(users);
@@ -155,6 +161,7 @@ export const postDataApiRouter = createTRPCRouter({
errors: [ errors: [
{ message: "Some users don't have a session to post data with" }, { message: "Some users don't have a session to post data with" },
], ],
data: [],
}; };
} }
@@ -179,6 +186,7 @@ export const postDataApiRouter = createTRPCRouter({
errors: [ errors: [
{ message: "No data found to post for the selected date and draw" }, { message: "No data found to post for the selected date and draw" },
], ],
data: [],
}; };
} }
@@ -188,6 +196,7 @@ export const postDataApiRouter = createTRPCRouter({
ok: true, ok: true,
data: [], data: [],
users: [], users: [],
detail: "Data posted successfully",
}; };
// const res = await postDataToApi({ // const res = await postDataToApi({