Closed kkazala closed 6 months ago
Yes, as we expand the implementation of graph endpoints in v4 this has been already addressed. That said, you can easily do this is v3 by using the graphPost
method as explained in the documentation.
awesome, good to know :)
I actually managed to do it with graphPost
but I'm not sure if I can/how to batch it
const id ="AAMkADU...."
let eventsQuery = GraphQueryable(
this.graph.users.getById(mailboxId).events,
`${id}/cancel`
);
let result = await graphPost(eventsQuery, { body: JSON.stringify({ "Comment": "Cancelling for this week due to all hands" })})
Is batching supported for graphPost
?
Hi! Yes, this can be achieved with graphPost. Please review the following code sample.
const [batch, execute] = graph.batched();
let eventsQuery = GraphQueryable(batch.me.events.getById('123'), '/cancel');
let eventsQuery2 = GraphQueryable(batch.me.events.getById('1234'), '/cancel');
graphPost(eventsQuery, body({ comment: "Cancelling event"}));
graphPost(eventsQuery2, body({ comment: "Cancelling event"}));
await execute();
thank you @bcameron1231! this was spot on and saved me a lot of time trying to figure it out =)
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
What version of PnPjs library you are using
3.x
Minor Version Number
17
Target environment
NodeJS
Additional environment details
I'm writing Azure Function, but it doesn't matter for this question =)
Question/Request
Would it be possible to add
cancel
to the @pnp/graph/calendars API? Delete doesn't allow defining cancellation message, while cancel does