Adds GSheet read&write API

This commit is contained in:
forceoranj
2021-10-23 03:34:19 +02:00
parent 3398f4f42d
commit 2616b109d7
17 changed files with 881 additions and 17754 deletions

36
src/services/envies.ts Normal file
View File

@@ -0,0 +1,36 @@
import axios from "axios"
import config from "../config"
export class Envie {
domaine = ""
envies = ""
precisions = ""
equipes = []
dateAjout = new Date(0)
}
export interface EnviesResponse {
data?: Envie[]
error?: Error
}
export const getEnvieList = async (): Promise<EnviesResponse> => {
try {
const { data } = await axios.get(`${config.API_URL}/GetList`)
return { data }
} catch (error) {
return { error: error as Error }
}
}
export const setEnvieList = async (list: Envie[]): Promise<EnviesResponse> => {
try {
const { data } = await axios.post(`${config.API_URL}/SetList`, list)
return { data }
} catch (error) {
return { error: error as Error }
}
}

View File

@@ -2,22 +2,36 @@ import axios from "axios"
import config from "../config"
export interface JeuxJav {
id: number
titre: string
auteur: string
editeur: string
minJoueurs: number
maxJoueurs: number
duree: number
type: "Ambiance" | "Famille" | "Expert" | ""
poufpaf: string
bggId: number
exemplaires: number // Defaults to 1
dispoPret: number
nonRangee: number
ean: string
bggPhoto: string
export class JeuxJav {
id = 0
titre = ""
auteur = ""
editeur = ""
minJoueurs = 0
maxJoueurs = 0
duree = 0
type: "Ambiance" | "Famille" | "Expert" | "" = ""
poufpaf = ""
bggId = 0
exemplaires = 1
dispoPret = 0
nonRangee = 0
ean = ""
bggPhoto = ""
}
export interface JeuxJavList {