From 6596f5a1280cc0b85416c0a705e6fe456f58a833 Mon Sep 17 00:00:00 2001 From: Beau Cameron Date: Tue, 26 Sep 2023 16:56:14 -0600 Subject: [PATCH 1/2] Fixes Message mapping in Graph sendMail method --- packages/graph/messages/users.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/graph/messages/users.ts b/packages/graph/messages/users.ts index 0712770bd..2af42f582 100644 --- a/packages/graph/messages/users.ts +++ b/packages/graph/messages/users.ts @@ -2,19 +2,20 @@ import { addProp, body } from "@pnp/queryable"; import { _User, User } from "../users/types.js"; import { IMessages, Messages, IMailboxSettings, MailboxSettings, IMailFolders, MailFolders, IMessage } from "./types.js"; import { graphPost } from "../operations.js"; +import { Message } from "@microsoft/microsoft-graph-types"; declare module "../users/types" { interface _User { readonly messages: IMessages; readonly mailboxSettings: IMailboxSettings; readonly mailFolders: IMailFolders; - sendMail(message: IMessage): Promise; + sendMail(message: Message): Promise; } interface IUser { readonly messages: IMessages; readonly mailboxSettings: IMailboxSettings; readonly mailFolders: IMailFolders; - sendMail(message: IMessage): Promise; + sendMail(message: Message): Promise; } } @@ -22,6 +23,6 @@ addProp(_User, "messages", Messages); addProp(_User, "mailboxSettings", MailboxSettings); addProp(_User, "mailFolders", MailFolders); -_User.prototype.sendMail = function (this: _User, message: IMessage): Promise { +_User.prototype.sendMail = function (message: Message): Promise { return graphPost(User(this, "sendMail"), body(message)); }; From e5b90dda2714c05b78d531ccd52eca6db31517c2 Mon Sep 17 00:00:00 2001 From: Beau Cameron Date: Tue, 26 Sep 2023 17:00:38 -0600 Subject: [PATCH 2/2] Remove unused import --- packages/graph/messages/users.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graph/messages/users.ts b/packages/graph/messages/users.ts index 2af42f582..fba861a72 100644 --- a/packages/graph/messages/users.ts +++ b/packages/graph/messages/users.ts @@ -1,6 +1,6 @@ import { addProp, body } from "@pnp/queryable"; import { _User, User } from "../users/types.js"; -import { IMessages, Messages, IMailboxSettings, MailboxSettings, IMailFolders, MailFolders, IMessage } from "./types.js"; +import { IMessages, Messages, IMailboxSettings, MailboxSettings, IMailFolders, MailFolders } from "./types.js"; import { graphPost } from "../operations.js"; import { Message } from "@microsoft/microsoft-graph-types";