Some checks failed
✅ Check / 🔬 ESLint (push) Failing after 21s
✅ Check / 🏷️ Typecheck (push) Failing after 11s
✅ Check / 🔎 Test (push) Failing after 11s
✅ Check / e2e-test (push) Failing after 11s
✅ Check / 🔨 Build (push) Failing after 11s
🚀 Deploy / 🚀 Deploy (doc) (push) Failing after 12s
🚀 Deploy / 🚀 Deploy (demo) (push) Failing after 12s
🚀 Deploy / 🚀 Deploy (supabase) (push) Failing after 18s
16 lines
353 B
TypeScript
16 lines
353 B
TypeScript
import { type User } from "jsr:@supabase/supabase-js@2";
|
|
import { supabaseAdmin } from "./supabaseAdmin.ts";
|
|
|
|
/**
|
|
* Get the sale associated to the provided user.
|
|
*/
|
|
export const getUserSale = async (user: User) => {
|
|
return (
|
|
await supabaseAdmin
|
|
.from("sales")
|
|
.select("*")
|
|
.eq("user_id", user.id)
|
|
.single()
|
|
)?.data;
|
|
};
|