Files
lettersoup-online/002_source/cms/src/db/Customers/GetAllCount.tsx
louiscklaw 59cdf7257b ```
update Implement standardized documentation for all database modules, including purpose, rules, and requirements for each CRUD operation; refactor existing comments to follow new documentation standard
```
2025-05-17 10:02:05 +00:00

17 lines
382 B
TypeScript

// PURPOSE:
// Get total count of all customers
// REQ0006
//
// RULES:
// error handled by caller
// contain definition to collection only
//
import { pb } from '@/lib/pb';
import { COL_CUSTOMERS } from '@/constants';
export async function getAllCustomersCount(): Promise<number> {
const result = await pb.collection(COL_CUSTOMERS).getList(1, 1);
return result.totalItems;
}