Nick: fixes

This commit is contained in:
Nicolas 2024-10-24 23:13:30 -03:00
parent 29b34270c8
commit d965f2ce7d
3 changed files with 8 additions and 4 deletions

View File

@ -95,7 +95,7 @@ export async function getACUC(
while (retries < maxRetries) {
({ data, error } = await supabase_service.rpc(
"auth_credit_usage_chunk_test_17_credit_pack",
"auth_credit_usage_chunk_test_21_credit_pack",
{ input_key: api_key }
));
@ -125,8 +125,8 @@ export async function getACUC(
if (chunk !== null && useCache) {
setCachedACUC(api_key, chunk);
}
// Log the chunk for now
console.log(chunk);
// console.log(chunk);
return chunk;
} else {

View File

@ -362,6 +362,8 @@ export type AuthCreditUsageChunk = {
coupons: any[];
adjusted_credits_used: number; // credits this period minus coupons used
remaining_credits: number;
sub_user_id: string | null;
total_credits_sum: number;
};
export interface RequestWithMaybeACUC<

View File

@ -109,6 +109,8 @@ export async function sendNotificationInternal(
return { success: false };
}
// TODO: observation: Free credits people are not receiving notifications
const { data: recentData, error: recentError } = await supabase_service
.from("user_notifications")
.select("*")
@ -118,7 +120,7 @@ export async function sendNotificationInternal(
.lte("sent_date", endDateString);
if (recentError) {
Logger.debug(`Error fetching recent notifications: ${recentError}`);
Logger.debug(`Error fetching recent notifications: ${recentError.message}`);
return { success: false };
}