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

View File

@@ -4,6 +4,7 @@ export const languages = ref([
"German",
"Italian",
"Polish",
"Spanish",
]);
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<{
enabled: boolean;
language: string;
tone: string;
units: "Imperial" | "Metric";
}>()
.$defaultFn(() => ({
enabled: true,
language: "English",
tone: "Casual",
units: "Metric",
})),
});

View File

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

View File

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