fix build error

This commit is contained in:
2021-10-19 16:46:29 +02:00
parent beeac8c01b
commit f09c23373e
3 changed files with 13 additions and 5 deletions

View File

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

View File

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