This commit is contained in:
2021-07-21 11:37:42 +02:00
parent 384ae25439
commit f770e5d2d1
11 changed files with 49 additions and 149 deletions

View File

@@ -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}`
}

View File

@@ -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