mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-02-01 04:37:55 +01:00
fix build error
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import {Translation} from "~/types/types";
|
||||||
|
|
||||||
const translations = {
|
const translations = {
|
||||||
header: {
|
header: {
|
||||||
@@ -274,12 +275,12 @@ const translations = {
|
|||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
let informations = {}
|
let informations = {}
|
||||||
const response = await axios.get('https://athena.arthurdanjou.fr/translations', {
|
const response = await axios.get<{ translations: Translation[] }>('https://athena.arthurdanjou.fr/translations', {
|
||||||
headers: {
|
headers: {
|
||||||
authorization: `Bearer ${process.env.API_TOKEN}`
|
authorization: `Bearer ${process.env.API_TOKEN}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
response.data.translations.map(({ code, english }: any) => {
|
response.data.translations.map(({ code, english }: Translation) => {
|
||||||
informations = { ...informations, [code]: english }
|
informations = { ...informations, [code]: english }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import {Translation} from "~/types/types";
|
||||||
|
|
||||||
const translations = {
|
const translations = {
|
||||||
header: {
|
header: {
|
||||||
@@ -274,12 +275,12 @@ const translations = {
|
|||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
let informations = {}
|
let informations = {}
|
||||||
const response = await axios.get('https://athena.arthurdanjou.fr/translations', {
|
const response = await axios.get<{ translations: Translation[] }>('https://athena.arthurdanjou.fr/translations', {
|
||||||
headers: {
|
headers: {
|
||||||
authorization: `Bearer ${process.env.API_TOKEN}`
|
authorization: `Bearer ${process.env.API_TOKEN}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
response.data.translations.map(({ code, french }: any) => {
|
response.data.translations.map(({ code, french }: Translation) => {
|
||||||
informations = { ...informations, [code]: french }
|
informations = { ...informations, [code]: french }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ interface Form {
|
|||||||
subject: string
|
subject: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Translation {
|
||||||
|
code: string
|
||||||
|
french: string
|
||||||
|
english: string
|
||||||
|
}
|
||||||
|
|
||||||
interface Tag {
|
interface Tag {
|
||||||
slug: string
|
slug: string
|
||||||
}
|
}
|
||||||
@@ -29,4 +35,4 @@ interface State {
|
|||||||
email: string
|
email: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Form, Post, Tag, NewsletterForm, State }
|
export { Form, Translation, Post, Tag, NewsletterForm, State }
|
||||||
|
|||||||
Reference in New Issue
Block a user