mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-06-07 05:57:41 +00:00
vueuse removed
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
17dce65127
commit
1fc2cc0233
4 changed files with 9 additions and 104 deletions
98
package-lock.json
generated
98
package-lock.json
generated
|
@ -8,7 +8,6 @@
|
|||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@prisma/client": "^3.8.1",
|
||||
"@vueuse/core": "^7.5.5",
|
||||
"axios": "^0.25.0",
|
||||
"fastify": "^3.27.0",
|
||||
"fastify-compress": "^4.0.1",
|
||||
|
@ -896,78 +895,6 @@
|
|||
"vue": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@vueuse/core": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/core/-/core-7.5.5.tgz",
|
||||
"integrity": "sha512-RBDqmIoGfak4h3xdXa/Av+ibkb8NY044wEy6+PG2FAWNaID8/FkqmSFjbxogrbmpSX1yZ1PBHrM8DUp/FrIpbg==",
|
||||
"dependencies": {
|
||||
"@vueuse/shared": "7.5.5",
|
||||
"vue-demi": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/composition-api": "^1.1.0",
|
||||
"vue": "^2.6.0 || ^3.2.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vue/composition-api": {
|
||||
"optional": true
|
||||
},
|
||||
"vue": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@vueuse/core/node_modules/@vueuse/shared": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-7.5.5.tgz",
|
||||
"integrity": "sha512-mzzTsotHQRPnPAChy8iCv6ek/90CKYhAFyMRgNsMxpT0afZJkbMO/X0OaOu/1NuGbgb8UVjlsWKmCUgKTOF5hA==",
|
||||
"dependencies": {
|
||||
"vue-demi": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/composition-api": "^1.1.0",
|
||||
"vue": "^2.6.0 || ^3.2.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vue/composition-api": {
|
||||
"optional": true
|
||||
},
|
||||
"vue": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@vueuse/core/node_modules/vue-demi": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.12.1.tgz",
|
||||
"integrity": "sha512-QL3ny+wX8c6Xm1/EZylbgzdoDolye+VpCXRhI2hug9dJTP3OUJ3lmiKN3CsVV3mOJKwFi0nsstbgob0vG7aoIw==",
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"vue-demi-fix": "bin/vue-demi-fix.js",
|
||||
"vue-demi-switch": "bin/vue-demi-switch.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/composition-api": "^1.0.0-rc.1",
|
||||
"vue": "^3.0.0-0 || ^2.6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vue/composition-api": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/abab": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||
|
@ -7658,31 +7585,6 @@
|
|||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@vueuse/core": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/core/-/core-7.5.5.tgz",
|
||||
"integrity": "sha512-RBDqmIoGfak4h3xdXa/Av+ibkb8NY044wEy6+PG2FAWNaID8/FkqmSFjbxogrbmpSX1yZ1PBHrM8DUp/FrIpbg==",
|
||||
"requires": {
|
||||
"@vueuse/shared": "7.5.5",
|
||||
"vue-demi": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vueuse/shared": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-7.5.5.tgz",
|
||||
"integrity": "sha512-mzzTsotHQRPnPAChy8iCv6ek/90CKYhAFyMRgNsMxpT0afZJkbMO/X0OaOu/1NuGbgb8UVjlsWKmCUgKTOF5hA==",
|
||||
"requires": {
|
||||
"vue-demi": "*"
|
||||
}
|
||||
},
|
||||
"vue-demi": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.12.1.tgz",
|
||||
"integrity": "sha512-QL3ny+wX8c6Xm1/EZylbgzdoDolye+VpCXRhI2hug9dJTP3OUJ3lmiKN3CsVV3mOJKwFi0nsstbgob0vG7aoIw==",
|
||||
"requires": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"abab": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^3.8.1",
|
||||
"@vueuse/core": "^7.5.5",
|
||||
"axios": "^0.25.0",
|
||||
"fastify": "^3.27.0",
|
||||
"fastify-compress": "^4.0.1",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import apiService from '@/services/apiService'
|
||||
import { Wishlist, WishlistItem } from '@/types'
|
||||
import { ref } from 'vue'
|
||||
import { toReactive } from '@vueuse/core'
|
||||
const apiClient = apiService.getClient()
|
||||
|
||||
const refState = ref<Wishlist | any>({})
|
||||
|
@ -28,7 +27,7 @@ const updateItem = async (item: WishlistItem): Promise<void> => {
|
|||
export const useWishlistStore = (slugText: string) => {
|
||||
fetchBySlugUrl(slugText)
|
||||
return {
|
||||
list: toReactive(refState),
|
||||
list: refState,
|
||||
isLoading,
|
||||
hasError,
|
||||
updateItem,
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
<script setup lang="ts">
|
||||
import { WishlistItem as WishlistItemType } from '@/types'
|
||||
import { computed, watchEffect } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTitle } from '@vueuse/core'
|
||||
import { useWishlistStore, useModal } from '@/composables'
|
||||
import Tile from '@/components/Tile.vue'
|
||||
import { IconSpinner, IconError } from '@/components/icons'
|
||||
import WishlistItem from '@/components/WishlistItem.vue'
|
||||
import { useWishlistStore, useModal } from '@/composables'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const route = useRoute()
|
||||
const modal = useModal()
|
||||
|
||||
const { list, isLoading, hasError, updateItem } = useWishlistStore(
|
||||
route.params.slug as string
|
||||
)
|
||||
|
||||
const notBoughtItems = computed(() => {
|
||||
return list.items.filter((item: WishlistItemType) => item.bought === false)
|
||||
return list.value.items.filter(
|
||||
(item: WishlistItemType) => item.bought === false
|
||||
)
|
||||
})
|
||||
|
||||
const bought = async (item: WishlistItemType): Promise<void> => {
|
||||
|
|
Loading…
Add table
Reference in a new issue