mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 08:18:37 +01:00
new selfhosted version
This commit is contained in:
12
dashboard/server/api/user/onboarding/exists.ts
Normal file
12
dashboard/server/api/user/onboarding/exists.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
import { OnboardingModel } from '@schema/OnboardingSchema';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const ctx = await getRequestContext(event, 'flag:allowAnonRegistered');
|
||||
|
||||
const exists = await OnboardingModel.exists({ user_id: ctx.user_id });
|
||||
|
||||
return { exists: exists != null }
|
||||
|
||||
});
|
||||
18
dashboard/server/api/user/onboarding/send.post.ts
Normal file
18
dashboard/server/api/user/onboarding/send.post.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import { OnboardingModel } from '@schema/OnboardingSchema';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
//TODO: SELFHOST - Disable onboarding
|
||||
|
||||
const ctx = await getRequestContext(event);
|
||||
|
||||
const { job, analytics } = await readBody(event);
|
||||
|
||||
await OnboardingModel.updateOne({
|
||||
user_id: ctx.user_id,
|
||||
}, { job, analytics }, { upsert: true });
|
||||
|
||||
return { ok: true }
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user