.row {
display: flex;
flex-wrap: wrap;
}
.col-4 {
flex-basis: 33.33%;
}
.text-center {
text-align: center;
}
.mxw-300 {
max-width: 300px;
}
const liWrapper = function(val){
return `${val} `
}
const colWrapper = function(val){
return `
${obj.title}
`
}
const queryArticles = `
query Articles{
articles(where: {
category_some:{
name: "What's Hot"
}
}){
id
title
imageUrl
newImageUrl
category {
id
name
}
body
createdAt
}
}
`
document.getElementById("whatshot").innerHTML = "loading..."
const urlProd = "https://jbl-backend-production.herokuapp.com/graphql"
const urlDev = "https://jbl-backend-development-api.herokuapp.com/graphql"
fetch(urlProd, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({query: queryArticles})
})
.then(r => r.json())
.then(data => {
asdf = data.data.articles.map(a => {
return colWrapper(templateArticle(a))
}).join("")
document.getElementById("whatshot").innerHTML = asdf
});
${val}
`
}
const templateArticle = function(obj){
return `