feat: initial commit — storefront, convex backend, and shared packages
Completes the first milestone of The Pet Loft ecommerce platform: - apps/storefront: full customer-facing Next.js app with HeroUI (cart, checkout, orders, wishlist, product detail, shop, search, auth) - convex/: serverless backend with schema, queries, mutations, actions, HTTP routes, Stripe/Shippo integrations, and co-located tests - packages/types, packages/utils, packages/convex: shared workspace packages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
convex/model/categories.ts
Normal file
11
convex/model/categories.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { QueryCtx } from "../_generated/server";
|
||||
import { Id } from "../_generated/dataModel";
|
||||
|
||||
export async function getCategoryOrThrow(
|
||||
ctx: QueryCtx,
|
||||
id: Id<"categories">,
|
||||
) {
|
||||
const category = await ctx.db.get(id);
|
||||
if (!category) throw new Error("Category not found");
|
||||
return category;
|
||||
}
|
||||
Reference in New Issue
Block a user