MCPcopy Create free account
hub / github.com/chatmcp/mcpso / getRandomProjects

Function getRandomProjects

models/project.ts:136–152  ·  view source on GitHub ↗
(
  page: number,
  limit: number
)

Source from the content-addressed store, hash-verified

134}
135
136export async function getRandomProjects(
137 page: number,
138 limit: number
139): Promise<Project[]> {
140 const supabase = getSupabaseClient();
141 const { data, error } = await supabase
142 .from("projects")
143 .select("*")
144 .eq("status", ProjectStatus.Created)
145 .order("sort", { ascending: false })
146 .order("created_at", { ascending: false })
147 .range((page - 1) * limit, page * limit - 1);
148
149 if (error) return [];
150
151 return data.sort(() => Math.random() - 0.5);
152}
153
154export async function getProjectsWithKeyword(
155 keyword: string,

Callers 1

page.tsxFile · 0.90

Calls 1

getSupabaseClientFunction · 0.90

Tested by

no test coverage detected