mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-06-07 05:57:41 +00:00
small typescript adjustments
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
dea3aaf477
commit
9534bc270f
3 changed files with 6 additions and 9 deletions
|
@ -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,
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface Wishlist {
|
|||
description: string
|
||||
imageSrc: string
|
||||
slugUrlText: string
|
||||
items: WishlistItem[]
|
||||
items?: WishlistItem[]
|
||||
}
|
||||
export interface TileProp {
|
||||
title: string
|
||||
|
|
|
@ -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
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue