Skip to content

Add RESTful APIs for media #17691

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add RESTful APIs for media #17691

wants to merge 2 commits into from

Conversation

hishamco
Copy link
Member

@hishamco hishamco commented Mar 28, 2025

Fixes #15655

@hishamco
Copy link
Member Author

@muobeidat can you help me with testing the APIs?

@hishamco
Copy link
Member Author

I started testing the APIs with the help of .http file

@MikeAlhayek
Copy link
Member

I would move every request to it's own file similar approach to all of the existing endpoint we already have. Here is an example https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs

There is no need for IEndpoint interface. Also there is not need MapMediaApi extension since you can just register that once in the Startup using the same approach here https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs#L216-L218

@hishamco
Copy link
Member Author

hishamco commented Apr 8, 2025

First of all, it's still WIP PR :)

I would move every request to it's own file similar approach to all of the existing endpoint we already have

I saw what you have done before. TBH, I don't like to have every request in each file unless it's needed, like what I have, because there are many lists, create methods

There is no need for IEndpoint interface

I introduced the interface for a reason, but the PR is still incomplete. Then I will check if it will be needed or not

@sebastienros
Copy link
Member

We should group things by type and not actions, like FolderEndpoints instead of DeleteEndpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RESTful endpoint for basic Media CRUD
3 participants