Merge remote-tracking branch 'origin/translate' into front-styles
This commit is contained in:
@@ -169,21 +169,21 @@ if (productData.colors.length > 0) {
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
async function toggleFavorite() {
|
||||
const url = `/api/v1/restricted/product/favorite/${route.params.product_id}`
|
||||
// async function toggleFavorite() {
|
||||
// const url = `/api/v1/restricted/product/favorite/${route.params.product_id}`
|
||||
|
||||
try {
|
||||
if (!productData.is_favorite) {
|
||||
await useFetchJson(url, { method: 'POST' })
|
||||
} else {
|
||||
await useFetchJson(url, { method: 'DELETE' })
|
||||
}
|
||||
// try {
|
||||
// if (!productData.is_favorite) {
|
||||
// await useFetchJson(url, { method: 'POST' })
|
||||
// } else {
|
||||
// await useFetchJson(url, { method: 'DELETE' })
|
||||
// }
|
||||
|
||||
productData.is_favorite = !productData.is_favorite
|
||||
} catch (e: unknown) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
// productData.is_favorite = !productData.is_favorite
|
||||
// } catch (e: unknown) {
|
||||
// console.error(e)
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user