Spanish language and some housekeeping
This commit is contained in:
@@ -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;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export const languages = ref([
|
|||||||
"German",
|
"German",
|
||||||
"Italian",
|
"Italian",
|
||||||
"Polish",
|
"Polish",
|
||||||
|
"Spanish",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const tones = ref([
|
export const tones = ref([
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export default eventHandler(() => "pong");
|
|
||||||
@@ -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",
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ export default defineOAuthStravaEventHandler({
|
|||||||
data: {
|
data: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
language: "English",
|
language: "English",
|
||||||
tone: "Casual",
|
|
||||||
units: "Metric",
|
units: "Metric",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user