-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2791 from bcameron1231/fix-2789
Fixes Message mapping in Graph sendMail method
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
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"; | ||
|
||
declare module "../users/types" { | ||
interface _User { | ||
readonly messages: IMessages; | ||
readonly mailboxSettings: IMailboxSettings; | ||
readonly mailFolders: IMailFolders; | ||
sendMail(message: IMessage): Promise<void>; | ||
sendMail(message: Message): Promise<void>; | ||
} | ||
interface IUser { | ||
readonly messages: IMessages; | ||
readonly mailboxSettings: IMailboxSettings; | ||
readonly mailFolders: IMailFolders; | ||
sendMail(message: IMessage): Promise<void>; | ||
sendMail(message: Message): Promise<void>; | ||
} | ||
} | ||
|
||
addProp(_User, "messages", Messages); | ||
addProp(_User, "mailboxSettings", MailboxSettings); | ||
addProp(_User, "mailFolders", MailFolders); | ||
|
||
_User.prototype.sendMail = function (this: _User, message: IMessage): Promise<void> { | ||
_User.prototype.sendMail = function (message: Message): Promise<void> { | ||
return graphPost(User(this, "sendMail"), body(message)); | ||
}; |