Lots of updates and cleaning up.

This commit is contained in:
2026-02-14 12:08:23 -06:00
parent 7466bbdeac
commit 3ab443790c
17 changed files with 484 additions and 52 deletions
+8 -2
View File
@@ -12,9 +12,15 @@ export default createRoute(
async (c) => {
const page = new Number(c.req.query("page") ?? 1) as number;
const rpp = new Number(c.req.query("rpp") ?? 30) as number; // Records Per Page
const companyQty = await companies.count();
const search = c.req.query("search") as string;
const data = await companies.fetchPages(page, rpp);
const data = search
? await companies.search(search, page, rpp)
: await companies.fetchPages(page, rpp);
const companyQty = search
? (await companies.search(search, 1, 999999)).length
: await companies.count();
let response = apiResponse.successful(
"Companies Fetched Successfully!",