This commit is contained in:
2020-12-15 19:02:24 +01:00
parent b2a91bb32e
commit 0ca62a1923
3 changed files with 5 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -127,11 +127,11 @@ export default {
error({ statusCode: 404, message: "Post not found" }); error({ statusCode: 404, message: "Post not found" });
}); });
const {data: likes} = await $axios.get(`posts/${params.slug}`) const {data: likes} = await $axios.get(`posts/${params.slug}`)
const liked = await $axios.get(`posts/is/${params.slug}`) const liked = 0 // await $axios.get(`posts/is/${params.slug}`)
return { return {
post, post,
likes, likes,
liked: liked.data !== 0 liked: 0//liked.data !== 0
} }
}, },
methods: { methods: {
@@ -149,7 +149,7 @@ export default {
}, 7000) }, 7000)
}, },
async handleLike() { async handleLike() {
if (this.liked) { /*if (this.liked) {
const {data} = await this.$axios.post(`posts/${this.post.slug}/unlike`) const {data} = await this.$axios.post(`posts/${this.post.slug}/unlike`)
if (data.code === 200) { if (data.code === 200) {
this.liked = false this.liked = false
@@ -161,7 +161,7 @@ export default {
this.liked = true this.liked = true
this.likes = data.post.likes this.likes = data.post.likes
} }
} }*/
} }
}, },
computed: { computed: {

View File

@@ -16,7 +16,7 @@
</nuxt-link> </nuxt-link>
</div> </div>
</div> </div>
<!--<img class="w-4/5 rounded-xl" :src="require(`@/assets/img/works/${work.cover}.png`)" alt="Project Img" /> --> <img class="w-4/5 rounded-xl" :src="require(`@/assets/img/works/${work.cover}.png`)" alt="Project Img" />
<a <a
class="mt-4 py-3 px-6 rounded-full cursor-pointer duration-300 mb-10 lg:mb-0" class="mt-4 py-3 px-6 rounded-full cursor-pointer duration-300 mb-10 lg:mb-0"
:class="'bg-' + work.color + '-400 hover:bg-' + work.color + '-600'" :class="'bg-' + work.color + '-400 hover:bg-' + work.color + '-600'"