mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-01-27 10:20:40 +01:00
Working
This commit is contained in:
@@ -137,7 +137,7 @@ export default defineComponent({
|
||||
const likes = ref(0)
|
||||
|
||||
useAsync(() => {
|
||||
$axios.get(`/posts/${slug.value}`, {
|
||||
$axios.get(`/api/posts/${slug.value}`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export default defineComponent({
|
||||
|
||||
const handleLike = async () => {
|
||||
if (liked.value) {
|
||||
const response = await $axios.post(`/posts/${post.value?.slug}/unlike`, {}, {
|
||||
const response = await $axios.post(`/api/posts/${post.value?.slug}/unlike`, {}, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
@@ -165,7 +165,7 @@ export default defineComponent({
|
||||
app.error({statusCode: 500})
|
||||
}
|
||||
} else {
|
||||
const response = await $axios.post(`/posts/${post.value?.slug}/like`, {}, {
|
||||
const response = await $axios.post(`/api/posts/${post.value?.slug}/like`, {}, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
}
|
||||
|
||||
@@ -34,15 +34,10 @@ export default defineComponent({
|
||||
const guestbook_messages = ref([])
|
||||
|
||||
useAsync(async () => {
|
||||
await $axios.get('guestbook', {
|
||||
await $axios.get('/api/guestbook', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${process.env.API_TOKEN}`
|
||||
},
|
||||
proxy: {
|
||||
protocol: 'https',
|
||||
host: 'https://api.arthurdanjou.fr',
|
||||
port: 80,
|
||||
},
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
guestbook_messages.value = response.data.guestbook_messages
|
||||
|
||||
Reference in New Issue
Block a user