Please specify what version of the library you are using: 1.2.9
Please specify what version(s) of SharePoint you are targeting: Online
I want to add / remove multiples users to a Site Group through batch command.
When I try to add / remove multiples users to a Site Group through batch command, nothing happens. Here's the code for add case:
const batch = this._currentWeb.createBatch();
this._currentWeb.siteGroups.getById(siteGroupId).users.inBatch(batch).add(user.id)
.then((value: SiteUser) => {
console.log(value);
})
.catch((error) => {
console.log(error);
});
}
await batch.execute()
.then(() => {
isOk = true
})
.catch((error) => {
console.log(error)
});
If I remove the "inBatch" part, it works both for adding and removing. Am I doing something wrong ?
Thank you for your help.
N/A
Just had a look, this is a bug in how the batch is getting processed. Working on a fix. Thanks!
Edit: this is the same issue but in the items case: https://github.com/pnp/pnpjs/issues/468
Ok, got a fix for this in #581
Most helpful comment
Ok, got a fix for this in #581