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