mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
17 lines
439 B
TypeScript
17 lines
439 B
TypeScript
|
|
import { OnboardingModel } from '@schema/OnboardingSchema';
|
|
|
|
|
|
const { SELFHOSTED } = useRuntimeConfig();
|
|
|
|
export default defineEventHandler(async event => {
|
|
const data = await getRequestData(event);
|
|
if (!data) return;
|
|
|
|
const exist = await OnboardingModel.exists({ user_id: data.user.id });
|
|
|
|
if (SELFHOSTED === 'TRUE' || SELFHOSTED === 'true') {
|
|
return { exists: true }
|
|
}
|
|
return { exist: exist != null }
|
|
}); |