Resolved all ts lint errors on build

This commit is contained in:
2022-08-11 18:37:33 +02:00
parent f7fe582200
commit 41067aae84
19 changed files with 130 additions and 66 deletions

View File

@@ -2,7 +2,7 @@
<section>
<LandingBanner />
<div v-for="list in lists" :key="list.name">
<div v-for="list in lists" :key="list.title">
<ResultsSection
:apiFunction="list.apiFunction"
:title="list.title"

View File

@@ -46,8 +46,9 @@
import SeasonedMessages from "@/components/ui/SeasonedMessages.vue";
import { register } from "../api";
import { focusFirstFormInput, focusOnNextElement } from "../utils";
import { ErrorMessageTypes } from "../interfaces/IErrorMessage";
import type { Ref } from "vue";
import type IErrorMessage from "../interfaces/IErrorMessage";
import type { IErrorMessage } from "../interfaces/IErrorMessage";
const username: Ref<string> = ref("");
const password: Ref<string> = ref("");
@@ -65,11 +66,19 @@
}
function addErrorMessage(message: string, title?: string) {
messages.value.push({ message, title, type: "error" });
messages.value.push({
message,
title,
type: ErrorMessageTypes.Error
} as IErrorMessage);
}
function addWarningMessage(message: string, title?: string) {
messages.value.push({ message, title, type: "warning" });
messages.value.push({
message,
title,
type: ErrorMessageTypes.Warning
} as IErrorMessage);
}
function validate(): Promise<boolean> {

View File

@@ -26,7 +26,7 @@
import PageHeader from "@/components/PageHeader.vue";
import ToggleButton from "@/components/ui/ToggleButton.vue";
import type { Ref } from "vue";
import { ListTypes } from "../interfaces/IList";
import { MediaTypes } from "../interfaces/IList";
// interface ISearchParams {
// query: string;
@@ -38,11 +38,11 @@
const route = useRoute();
const router = useRouter();
const toggleOptions = ["all", ...Object.values(ListTypes)];
const toggleOptions = ["all", ...Object.values(MediaTypes)];
const query: Ref<string> = ref(null);
const page: Ref<number> = ref(1);
const adult: Ref<boolean> = ref(false);
const mediaType: Ref<ListTypes> = ref(null);
const mediaType: Ref<MediaTypes> = ref(null);
const title = computed(() => `Search results: ${query.value}`);
@@ -51,7 +51,7 @@
query.value = decodeURIComponent(urlQuery?.query?.toString());
page.value = Number(urlQuery?.page) || 1;
adult.value = Boolean(urlQuery?.adult) || adult.value;
mediaType.value = (urlQuery?.media_type as ListTypes) || mediaType.value;
mediaType.value = (urlQuery?.media_type as MediaTypes) || mediaType.value;
}
let search = (

View File

@@ -37,8 +37,9 @@
import SeasonedMessages from "@/components/ui/SeasonedMessages.vue";
import { login } from "../api";
import { focusFirstFormInput, focusOnNextElement } from "../utils";
import { ErrorMessageTypes } from "../interfaces/IErrorMessage";
import type { Ref } from "vue";
import type IErrorMessage from "../interfaces/IErrorMessage";
import type { IErrorMessage } from "../interfaces/IErrorMessage";
const username: Ref<string> = ref("");
const password: Ref<string> = ref("");
@@ -55,11 +56,19 @@
}
function addErrorMessage(message: string, title?: string) {
messages.value.push({ message, title, type: "error" });
messages.value.push({
message,
title,
type: ErrorMessageTypes.Error
} as IErrorMessage);
}
function addWarningMessage(message: string, title?: string) {
messages.value.push({ message, title, type: "warning" });
messages.value.push({
message,
title,
type: ErrorMessageTypes.Warning
} as IErrorMessage);
}
function validate(): Promise<boolean> {