You have to use return fullUrl
as variable name
fetch(fullUrl)
You have used fetch('fullUrl')
, which is just a string fullUrl
.
Do also call your function getItems();
Your Code should look like this:
var fullUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('WeeklyReport1')/items?$select=Team,WeekOf,OffensiveReport,DefensiveReport,SpecialTeamsReport";
const getItems = () => {
return fetch(fullUrl)
.then(res => res.json())
.then(posts => console.log(posts))
}
getItems();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…