small typescript adjustments

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-05 14:58:20 +01:00
parent dea3aaf477
commit 9534bc270f
3 changed files with 6 additions and 9 deletions

View file

@ -2,15 +2,12 @@ import { prisma } from '../../services'
import { Wishlist, WishlistItem } from '@/types'
export default {
getAll: async (): Promise<any> => {
return await prisma.client.wishlist.findMany({
getAll: async (): Promise<Wishlist[]> => {
return (await prisma.client.wishlist.findMany({
include: { items: false },
})
})) as Wishlist[]
},
getBySlugUrlText: async (
value: string,
includeItems = false
): Promise<any> => {
getBySlugUrlText: async (value: string, includeItems = false) => {
return await prisma.client.wishlist.findUnique({
where: {
slugUrlText: value,

View file

@ -14,7 +14,7 @@ export interface Wishlist {
description: string
imageSrc: string
slugUrlText: string
items: WishlistItem[]
items?: WishlistItem[]
}
export interface TileProp {
title: string

View file

@ -16,7 +16,7 @@ const { list, fetch, updateItem } = useWishlistStore()
await fetch(route.params.slug as string)
const notBoughtItems = computed(() => {
return list.value?.items.filter(
return list.value?.items?.filter(
(item: WishlistItemType) => item.bought === false
)
})