mirror of
https://github.com/SrIzan10/helium.git
synced 2026-06-06 00:56:58 +00:00
16 lines
429 B
TypeScript
16 lines
429 B
TypeScript
import { getUserPresets } from "~/lib/utils/presetsDb";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const { isAuthenticated, userId } = event.context.auth();
|
|
console.log("Fetching presets for user:", userId);
|
|
if (!isAuthenticated) {
|
|
throw createError({ statusCode: 401, statusMessage: "Unauthorized" });
|
|
}
|
|
const data = await getUserPresets(userId);
|
|
|
|
return {
|
|
success: true,
|
|
data: data,
|
|
};
|
|
});
|