1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

Fix more typing issues (#928)

* Fix or comment several ts-ignores

* Fix typing related to BaseOverflowButton

* Remove unused functionality of useCookbooks, fix usage bug

* Fix more typing, add some comments

* Only allow ts-ignore if it has a comment
This commit is contained in:
Philipp Fischbeck 2022-01-16 03:38:11 +01:00 committed by GitHub
parent c4540f1395
commit f794208862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 126 additions and 249 deletions

View file

@ -68,6 +68,7 @@
import { defineComponent, reactive, toRefs, useContext, computed, onMounted } from "@nuxtjs/composition-api";
import { SupportedMigration } from "~/api/class-interfaces/group-migrations";
import { ReportSummary } from "~/api/class-interfaces/group-reports";
import { MenuItem } from "~/components/global/BaseOverflowButton.vue";
import { useUserApi } from "~/composables/api";
const MIGRATIONS = {
@ -92,7 +93,7 @@ export default defineComponent({
reports: [] as ReportSummary[],
});
const items = [
const items: MenuItem[] = [
{
text: "Nextcloud",
value: MIGRATIONS.nextcloud,

View file

@ -162,6 +162,7 @@ import { useRecipes, allRecipes } from "~/composables/recipes";
import { Recipe } from "~/types/api-types/recipe";
import GroupExportData from "~/components/Domain/Group/GroupExportData.vue";
import { GroupDataExport } from "~/api/class-interfaces/recipe-bulk-actions";
import { MenuItem } from "~/components/global/BaseOverflowButton.vue";
const MODES = {
tag: "tag",
@ -191,7 +192,7 @@ export default defineComponent({
id: false,
owner: false,
tags: true,
tools: "Tools",
tools: true,
categories: true,
recipeYield: false,
dateAdded: false,
@ -207,29 +208,25 @@ export default defineComponent({
dateAdded: "Date Added",
};
const actions = [
const actions: MenuItem[] = [
{
icon: $globals.icons.database,
text: "Export",
value: 0,
event: "export-selected",
},
{
icon: $globals.icons.tags,
text: "Tag",
value: 1,
event: "tag-selected",
},
{
icon: $globals.icons.tags,
text: "Categorize",
value: 2,
event: "categorize-selected",
},
{
icon: $globals.icons.delete,
text: "Delete",
value: 3,
event: "delete-selected",
},
];
@ -264,7 +261,6 @@ export default defineComponent({
// All Recipes
function selectAll() {
// @ts-ignore
selected.value = allRecipes.value;
}

View file

@ -116,6 +116,7 @@ import { ref, reactive, defineComponent, computed, useContext, watch } from "@nu
import { useUserApi } from "~/composables/api";
import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
import { VForm } from "~/types/vuetify";
import { UserOut } from "~/types/api-types/user";
export default defineComponent({
components: {
@ -123,7 +124,7 @@ export default defineComponent({
},
setup() {
const nuxtContext = useContext();
const user = computed(() => nuxtContext.$auth.user);
const user = computed(() => nuxtContext.$auth.user as unknown as UserOut);
watch(user, () => {
userCopy.value = { ...user.value };
@ -141,7 +142,6 @@ export default defineComponent({
});
async function updateUser() {
// @ts-ignore
const { response } = await api.users.updateOne(userCopy.value.id, userCopy.value);
if (response?.status === 200) {
nuxtContext.$auth.fetchUser();
@ -152,7 +152,6 @@ export default defineComponent({
if (!userCopy.value?.id) {
return;
}
// @ts-ignore
const { response } = await api.users.changePassword(userCopy.value.id, {
currentPassword: password.current,
newPassword: password.newOne,