Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates m365 file move command to use drive.ts instead of driveUtil.ts #6423

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/m365/file/commands/file-move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import commands from '../commands.js';
import request, { CliRequestOptions } from '../../../request.js';
import { spo } from '../../../utils/spo.js';
import { urlUtil } from '../../../utils/urlUtil.js';
import { driveUtil } from '../../../utils/driveUtil.js';
import { drive } from '../../../utils/drive.js';
import { validation } from '../../../utils/validation.js';

interface CommandArgs {
Expand Down Expand Up @@ -115,9 +115,9 @@ class FileMoveCommand extends GraphCommand {

private async getDriveIdAndItemId(webUrl: string, folderUrl: string, sourceUrl: string, logger: Logger, verbose?: boolean): Promise<{ driveId: string, itemId: string }> {
const siteId: string = await spo.getSiteId(webUrl, logger, verbose);
const drive: Drive = await driveUtil.getDriveByUrl(siteId, new URL(folderUrl));
const itemId: string = await driveUtil.getDriveItemId(drive, new URL(folderUrl));
return { driveId: drive.id as string, itemId };
const driveDetails: Drive = await drive.getDriveByUrl(siteId, new URL(folderUrl), logger, verbose);
const itemId: string = await drive.getDriveItemId(driveDetails, new URL(folderUrl), logger, verbose);
return { driveId: driveDetails.id as string, itemId };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return { driveId: driveDetails.id as string, itemId };
return { driveId: driveDetails.id!, itemId };

}

private getRequestOptions(sourceDriveId: string, sourceItemId: string, targetDriveId: string, targetItemId: string, newName: string | undefined, sourcePath: string, nameConflictBehavior: string | undefined): CliRequestOptions {
Expand Down
63 changes: 0 additions & 63 deletions src/utils/driveUtil.ts

This file was deleted.