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'
|
import { Wishlist, WishlistItem } from '@/types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getAll: async (): Promise<any> => {
|
getAll: async (): Promise<Wishlist[]> => {
|
||||||
return await prisma.client.wishlist.findMany({
|
return (await prisma.client.wishlist.findMany({
|
||||||
include: { items: false },
|
include: { items: false },
|
||||||
})
|
})) as Wishlist[]
|
||||||
},
|
},
|
||||||
getBySlugUrlText: async (
|
getBySlugUrlText: async (value: string, includeItems = false) => {
|
||||||
value: string,
|
|
||||||
includeItems = false
|
|
||||||
): Promise<any> => {
|
|
||||||
return await prisma.client.wishlist.findUnique({
|
return await prisma.client.wishlist.findUnique({
|
||||||
where: {
|
where: {
|
||||||
slugUrlText: value,
|
slugUrlText: value,
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface Wishlist {
|
||||||
description: string
|
description: string
|
||||||
imageSrc: string
|
imageSrc: string
|
||||||
slugUrlText: string
|
slugUrlText: string
|
||||||
items: WishlistItem[]
|
items?: WishlistItem[]
|
||||||
}
|
}
|
||||||
export interface TileProp {
|
export interface TileProp {
|
||||||
title: string
|
title: string
|
||||||
|
|
|
@ -16,7 +16,7 @@ const { list, fetch, updateItem } = useWishlistStore()
|
||||||
await fetch(route.params.slug as string)
|
await fetch(route.params.slug as string)
|
||||||
|
|
||||||
const notBoughtItems = computed(() => {
|
const notBoughtItems = computed(() => {
|
||||||
return list.value?.items.filter(
|
return list.value?.items?.filter(
|
||||||
(item: WishlistItemType) => item.bought === false
|
(item: WishlistItemType) => item.bought === false
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue