Nick: fixes
This commit is contained in:
@@ -95,7 +95,7 @@ export async function getACUC(
|
|||||||
|
|
||||||
while (retries < maxRetries) {
|
while (retries < maxRetries) {
|
||||||
({ data, error } = await supabase_service.rpc(
|
({ 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 }
|
{ input_key: api_key }
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -125,8 +125,8 @@ export async function getACUC(
|
|||||||
if (chunk !== null && useCache) {
|
if (chunk !== null && useCache) {
|
||||||
setCachedACUC(api_key, chunk);
|
setCachedACUC(api_key, chunk);
|
||||||
}
|
}
|
||||||
// Log the chunk for now
|
|
||||||
console.log(chunk);
|
// console.log(chunk);
|
||||||
|
|
||||||
return chunk;
|
return chunk;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -362,6 +362,8 @@ export type AuthCreditUsageChunk = {
|
|||||||
coupons: any[];
|
coupons: any[];
|
||||||
adjusted_credits_used: number; // credits this period minus coupons used
|
adjusted_credits_used: number; // credits this period minus coupons used
|
||||||
remaining_credits: number;
|
remaining_credits: number;
|
||||||
|
sub_user_id: string | null;
|
||||||
|
total_credits_sum: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RequestWithMaybeACUC<
|
export interface RequestWithMaybeACUC<
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ export async function sendNotificationInternal(
|
|||||||
return { success: false };
|
return { success: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: observation: Free credits people are not receiving notifications
|
||||||
|
|
||||||
const { data: recentData, error: recentError } = await supabase_service
|
const { data: recentData, error: recentError } = await supabase_service
|
||||||
.from("user_notifications")
|
.from("user_notifications")
|
||||||
.select("*")
|
.select("*")
|
||||||
@@ -118,7 +120,7 @@ export async function sendNotificationInternal(
|
|||||||
.lte("sent_date", endDateString);
|
.lte("sent_date", endDateString);
|
||||||
|
|
||||||
if (recentError) {
|
if (recentError) {
|
||||||
Logger.debug(`Error fetching recent notifications: ${recentError}`);
|
Logger.debug(`Error fetching recent notifications: ${recentError.message}`);
|
||||||
return { success: false };
|
return { success: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user