Move to sqlite off cloud
This commit is contained in:
@@ -5,13 +5,13 @@ import {
|
||||
availableTones,
|
||||
availableUnits,
|
||||
} from "~/shared/constants";
|
||||
//
|
||||
|
||||
const bodySchema = z.strictObject({
|
||||
enabled: z.boolean(),
|
||||
language: z.enum(availableLanguages),
|
||||
units: z.enum(availableUnits),
|
||||
tone: z.array(z.enum(availableTones)),
|
||||
highlights: z.array(z.enum(availableHighlights)),
|
||||
units: z.enum(availableUnits).default(availableUnits[1]),
|
||||
tone: z.array(z.enum(availableTones)).default([]),
|
||||
highlights: z.array(z.enum(availableHighlights)).default([]),
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
|
||||
@@ -32,25 +32,25 @@ export default defineEventHandler(async (event) => {
|
||||
user: user!,
|
||||
}).catch((err) => [err]);
|
||||
if (aiError) {
|
||||
console.log(aiError.message);
|
||||
throw createError({
|
||||
statusCode: 500,
|
||||
message: `OPENAI API: ${aiError.message}`,
|
||||
});
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(stravaRequestBody));
|
||||
|
||||
// await strava!(`activities/${body.object_id}`, {
|
||||
// method: "PUT",
|
||||
// body: {
|
||||
// name: stravaRequestBody.name,
|
||||
// description: stravaRequestBody.description,
|
||||
// },
|
||||
// }).catch((error) => {
|
||||
// throw createError({
|
||||
// statusCode: 500,
|
||||
// message: `Strava API: ${error.message}`,
|
||||
// });
|
||||
// });
|
||||
await strava!(`activities/${body.object_id}`, {
|
||||
method: "PUT",
|
||||
body: {
|
||||
name: (stravaRequestBody.name as String).replaceAll("—", ","),
|
||||
description: (stravaRequestBody.description as String).replaceAll(
|
||||
"—",
|
||||
",",
|
||||
),
|
||||
},
|
||||
}).catch((error) => {
|
||||
throw createError({
|
||||
statusCode: 500,
|
||||
message: `Strava API: ${error.message}`,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,8 +4,6 @@ import { eq } from "drizzle-orm";
|
||||
export default defineEventHandler(async (event) => {
|
||||
await validateHookdeck(event);
|
||||
|
||||
const posthog = event.context.posthog;
|
||||
|
||||
const body = await readBody(event);
|
||||
const db = useDrizzle();
|
||||
|
||||
@@ -13,13 +11,6 @@ export default defineEventHandler(async (event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const user = await db.query.users.findFirst({
|
||||
where: (f, o) => o.eq(f.id, get(body, "object_id")),
|
||||
with: {
|
||||
preferences: true,
|
||||
},
|
||||
});
|
||||
|
||||
await db
|
||||
.delete(tables.users)
|
||||
.where(eq(tables.users.id, get(body, "object_id")));
|
||||
|
||||
Reference in New Issue
Block a user