Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount() {
- const select = ['ServerRelativeUrl', 'Title'];
- this.sp.getSubwebsFilteredForCurrentUser()
- .select(...select)
- .get()
- .then(projects => {
- const configuredProjects = [];
- projects.map(project => {
- const endOfThePage = project.ServerRelativeUrl.split('/')[2];
- const projectPage = new pnp.Web(`XXX`);
- projectPage.lists.getByTitle('Strony witryny')
- .items
- .select('BannerImageUrl', 'Description', 'Czy_x0020_promowany_x003F_', 'Czy_x0020_prywatny_x003F_', 'Tagi', 'Zrealizowany')
- .filter("Title eq 'Strona główna'")
- .filter("Czy_x0020_prywatny_x003F_ eq 'False'")
- .getAll()
- .then(items => {
- items.map(item => {
- const singleProject = {
- "Title" : project.Title,
- "Informations" : item
- };
- configuredProjects.push(singleProject);
- })
- })
- })
- return Promise.all(configuredProjects.map((p, index) => ({...p, index})));
- })
- .then(configuredProjects => {
- console.log('Then configured projects', configuredProjects);
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement