Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount() {
- const configuredProjects = [];
- const select = ['ServerRelativeUrl', 'Title'];
- this.sp.getSubwebsFilteredForCurrentUser()
- .select(...select)
- .get()
- .then(projects => {
- projects.map(project => {
- const endOfThePage = project.ServerRelativeUrl.split('/')[2];
- const projectPage = new pnp.Web(`http://biw-test.mazowia.eu/projekty/${endOfThePage}`);
- 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'")
- .getAll()
- .then(items => {
- items.map(item => {
- let singleProject = {
- "Title" : project.Title,
- "Informations" : item
- }
- configuredProjects.push(singleProject);
- })
- })
- })
- });
- this.allProjects = configuredProjects;
- this.setState({
- ...this.state,
- projects: this.allProjects
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement