Add child folders support for Microsoft (#15114)
This commit is contained in:
+6
@@ -14,8 +14,12 @@ import { getStandardFolderByRegex } from 'src/modules/messaging/message-import-m
|
||||
type MicrosoftGraphFolder = {
|
||||
id: string;
|
||||
displayName: string;
|
||||
childFolderCount?: number;
|
||||
parentFolderId?: string;
|
||||
};
|
||||
|
||||
const MESSAGING_MICROSOFT_MAIL_FOLDERS_LIST_MAX_RESULT = 999;
|
||||
|
||||
@Injectable()
|
||||
export class MicrosoftGetAllFoldersService implements MessageFolderDriver {
|
||||
private readonly logger = new Logger(MicrosoftGetAllFoldersService.name);
|
||||
@@ -37,6 +41,8 @@ export class MicrosoftGetAllFoldersService implements MessageFolderDriver {
|
||||
|
||||
const response = await microsoftClient
|
||||
.api('/me/mailFolders')
|
||||
.version('beta')
|
||||
.top(MESSAGING_MICROSOFT_MAIL_FOLDERS_LIST_MAX_RESULT)
|
||||
.get()
|
||||
.catch((error) => {
|
||||
this.logger.error(
|
||||
|
||||
Reference in New Issue
Block a user