0

Update search.ts

This commit is contained in:
Nicolas 2024-06-06 20:02:21 -07:00
parent 5e80f8af87
commit 98d82c4cec

View File

@ -44,7 +44,20 @@ export async function searchHelper(
let justSearch = pageOptions.fetchPageContent === false; let justSearch = pageOptions.fetchPageContent === false;
if (justSearch) { if (justSearch) {
const billingResult = await billTeam(
team_id,
res.length
);
if (!billingResult.success) {
return {
success: false,
error:
"Failed to bill team. Insufficient credits or subscription not found.",
returnCode: 402,
};
}
return { success: true, data: res, returnCode: 200 }; return { success: true, data: res, returnCode: 200 };
} }