Add child folders support for Microsoft (#15114)

This commit is contained in:
neo773
2025-10-17 02:16:58 +05:30
committed by GitHub
parent 4e3c37809c
commit 709bdc74c3
2 changed files with 14 additions and 0 deletions
@@ -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(