PreRelease v1
This commit is contained in:
14
lib/actions/stats.action.ts
Normal file
14
lib/actions/stats.action.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import { auth } from "@clerk/nextjs/server";
|
||||
import { getUserStats } from "@/lib/services/stats.service";
|
||||
|
||||
export async function getStatsAction() {
|
||||
const { userId } = await auth();
|
||||
|
||||
if (!userId) {
|
||||
return { success: false, error: "Unauthorized" };
|
||||
}
|
||||
|
||||
return await getUserStats(userId);
|
||||
}
|
||||
Reference in New Issue
Block a user