({
page = 1,
limit = 36,
search,
}: {
page?: number;
limit?: number;
search?: string | null;
} = {})
| 60 | } |
| 61 | |
| 62 | export async function getMCPsClient({ |
| 63 | page = 1, |
| 64 | limit = 36, |
| 65 | search, |
| 66 | }: { |
| 67 | page?: number; |
| 68 | limit?: number; |
| 69 | search?: string | null; |
| 70 | } = {}) { |
| 71 | const supabase = createClient(); |
| 72 | const query = supabase |
| 73 | .from("mcps") |
| 74 | .select("*") |
| 75 | .eq("active", true) |
| 76 | .order("company_id", { ascending: true, nullsFirst: false }) |
| 77 | .limit(limit) |
| 78 | .range((page - 1) * limit, page * limit - 1); |
| 79 | |
| 80 | if (search) { |
| 81 | query.textSearch("fts", `%${search}%:*`); |
| 82 | } |
| 83 | |
| 84 | const { data, error } = await query; |
| 85 | |
| 86 | return { data, error }; |
| 87 | } |
nothing calls this directly
no test coverage detected