Skip to content

Enhances command spo list remove#6378

Closed
ktskumar wants to merge 2 commits intopnp:mainfrom
ktskumar:issues-6270
Closed

Enhances command spo list remove#6378
ktskumar wants to merge 2 commits intopnp:mainfrom
ktskumar:issues-6270

Conversation

@ktskumar
Copy link
Copy Markdown
Contributor

closes #6270

In this PR, i have added a recycle option to spo list remove command

@milanholemans
Copy link
Copy Markdown
Contributor

Thank you, we'll try to review it ASAP!

@milanholemans milanholemans self-assigned this Oct 15, 2024
Copy link
Copy Markdown
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

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

Nice start, let's do a few enhancements before we continue.

Comment thread src/m365/spo/commands/list/list-remove.ts Outdated
Comment thread src/m365/spo/commands/list/list-remove.ts
Comment thread src/m365/spo/commands/list/list-remove.ts Outdated
Comment thread src/m365/spo/commands/list/list-remove.spec.ts
Comment thread src/m365/spo/commands/list/list-remove.spec.ts Outdated
Comment thread src/m365/spo/commands/list/list-remove.spec.ts
Comment thread docs/docs/cmd/spo/list/list-remove.mdx Outdated
Comment thread docs/docs/cmd/spo/list/list-remove.mdx Outdated
@milanholemans milanholemans marked this pull request as draft October 15, 2024 22:40
@ktskumar
Copy link
Copy Markdown
Contributor Author

I have done rebase to main and added the commit. Is it fine or do I need to resolve anything from my end. Please guide me

@milanholemans
Copy link
Copy Markdown
Contributor

@ktskumar seems like something went horribly wrong while rebasing with the latest main. Could you have a look at it, please?
When you are done, you can mark the PR as ready for review.

@ktskumar ktskumar marked this pull request as ready for review October 16, 2024 10:19
Copy link
Copy Markdown
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

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

Apart from a few comments, it looks good to go!

sinon.stub(cli, 'promptForConfirmation').callsFake(async () => {
promptIssued = true;
return Promise.resolve(false);
//return Promise.resolve(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's remove comments

sinon.stub(request, 'post').callsFake(async (opts) => {
requests.push(opts);
if (opts.url === `${webUrl}/_api/web/lists/GetByTitle('${listTitle}')/recycle`) {
return 'Correct URL';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This API doesn't return any result. Let's also return nothing in our stub.

Comment on lines +161 to +165
requests.forEach(r => {
if (r.url === `${webUrl}/_api/web/lists/GetByTitle('${listTitle}')/recycle`) {
correctRequestIssued = true;
}
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of doing this, let's use assert(postStub.calledOnce). This ensures that the request was called once and didn't throw an error.

@milanholemans
Copy link
Copy Markdown
Contributor

Merged manually, thanks!

MartinM85 added a commit to MartinM85/cli-microsoft365 that referenced this pull request Feb 15, 2026
MartinM85 added a commit to MartinM85/cli-microsoft365 that referenced this pull request Feb 15, 2026
MartinM85 added a commit to MartinM85/cli-microsoft365 that referenced this pull request Feb 15, 2026
MartinM85 added a commit to MartinM85/cli-microsoft365 that referenced this pull request Feb 16, 2026
MartinM85 added a commit to MartinM85/cli-microsoft365 that referenced this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: spo list remove add possibility to recycle

2 participants