Skip to content

Instantly share code, notes, and snippets.

@Romakita
Created July 9, 2019 08:45
Show Gist options
  • Save Romakita/d0c59e1bc328e4fb56c3b97a42b8a134 to your computer and use it in GitHub Desktop.
Save Romakita/d0c59e1bc328e4fb56c3b97a42b8a134 to your computer and use it in GitHub Desktop.
CarsClient example
const HOST = ''
export async function getCars() {
// should be axios
// const { data } = await axios.get(`${HOST}/cars`)
// return data
//
// Right now we don't have server so we create mocked data
return [
{
id: 1,
title: "Peugeot 2008 1",
imgUrl: "https://www.automobile-magazine.fr/asset/cms/840x394/161635/config/111991/peugeot-2008-1906pc-129.jpg",
view: "side",
year: "2019"
},
{
id: 2,
title: "Peugeot 2008 1",
imgUrl: "https://www.automobile-magazine.fr/asset/cms/840x394/161636/config/111992/peugeot-2008-1906pc-126.jpg",
view: "side",
year: ""
},
{
id: 3,
title: "Peugeot 2008 1",
imgUrl: "https://www.automobile-magazine.fr/asset/cms/840x394/163239/config/112119/la-longueur-augmente-de-14-cm-pour-atteindre-430-m.jpg",
view: "side"
}, {
id: 4,
title: "Renault Captur 1",
imgUrl: "https://img.autoplus.fr/picture/renault/captur/1540159/Renault_Captur_2019_03b29-1200-800.jpg",
view: "side",
year: "2019"
},
{
id: 5,
title: "Renault Captur 1",
imgUrl: "https://img.autoplus.fr/news/2019/07/03/1540178/1200%7C800%7C5c4c8832137f48d852a5d73d.jpg",
view: "side",
year: "2019"
},
{
id: 6,
title: "Renault Captur 1",
imgUrl: "https://img.autoplus.fr/picture/renault/captur/1540159/Renault_Captur_2019_68b36-1200-800.jpg",
view: "side",
year: "2019"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment