Update search.ts

This commit is contained in:
Nicolas 2024-06-06 20:02:21 -07:00
parent 5e80f8af87
commit 98d82c4cec
1 changed files with 13 additions and 0 deletions

View File

@ -43,8 +43,21 @@ export async function searchHelper(
});
let justSearch = pageOptions.fetchPageContent === false;
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 };
}