Spanish language and some housekeeping

This commit is contained in:
2025-05-12 16:38:33 +03:00
parent 1461f32a21
commit 7096302999
6 changed files with 5 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { omit } from "radash";
useHead({ title: "Ghostwriter" }); useHead({ title: "Ghostwriter" });
const { user } = useUserSession(); const { user } = useUserSession();
@@ -10,14 +12,12 @@ const stravaLink = computed(() => {
interface FormData { interface FormData {
enabled: boolean; enabled: boolean;
language: string; language: string;
tone: string;
units: string; units: string;
} }
const preferences = useState<FormData>("preferences", () => ({ const preferences = useState<FormData>("preferences", () => ({
enabled: false, enabled: false,
language: "English", language: "English",
tone: "Casual",
units: "Metric", units: "Metric",
})); }));
@@ -27,7 +27,7 @@ const { status } = useFetch("/api/preferences", {
return; return;
} }
preferences.value = { ...response._data }; preferences.value = omit(response._data, ["tone"]) as FormData;
}, },
}); });

View File

@@ -4,6 +4,7 @@ export const languages = ref([
"German", "German",
"Italian", "Italian",
"Polish", "Polish",
"Spanish",
]); ]);
export const tones = ref([ export const tones = ref([

View File

@@ -1 +0,0 @@
export default eventHandler(() => "pong");

View File

@@ -32,13 +32,11 @@ export const preferences = pgTable("preferences", {
.$type<{ .$type<{
enabled: boolean; enabled: boolean;
language: string; language: string;
tone: string;
units: "Imperial" | "Metric"; units: "Imperial" | "Metric";
}>() }>()
.$defaultFn(() => ({ .$defaultFn(() => ({
enabled: true, enabled: true,
language: "English", language: "English",
tone: "Casual",
units: "Metric", units: "Metric",
})), })),
}); });

View File

@@ -70,7 +70,6 @@ export default defineOAuthStravaEventHandler({
data: { data: {
enabled: true, enabled: true,
language: "English", language: "English",
tone: "Casual",
units: "Metric", units: "Metric",
}, },
}) })

View File

@@ -10,6 +10,7 @@ const movingActivityTypes = [
"Crossfit", "Crossfit",
"EBikeRide", "EBikeRide",
"Elliptical", "Elliptical",
"Handcycle",
"Hike", "Hike",
"IceSkate", "IceSkate",
"InlineSkate", "InlineSkate",
@@ -38,7 +39,6 @@ const movingActivityTypes = [
]; ];
const staticActivityTypes = [ const staticActivityTypes = [
"Handcycle",
"Soccer", "Soccer",
"Workout", "Workout",
"WeightTraining", "WeightTraining",