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

enhance Api::actionSearch #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

enhance Api::actionSearch #40

wants to merge 3 commits into from

Conversation

handcode
Copy link
Member

enhance Api::actionSearch

  • add more (missing?) item properties
  • add new action param $basePath to be able to limit the search with subfolders as path prefix
  • move getting additional item properties via optional callbacks (urls, thumb, preview) from actionList to own methods so these can be reused in other places like actionSearch

… thumb, preview) from actionList to own methods so these can be reused in other places
…new action param $basePath to be able to limit the search with subfolders as path prefix
@handcode handcode requested review from schmunk42 and eluhr January 16, 2025 11:49
@handcode
Copy link
Member Author

@eluhr @schmunk42

should be tested with dmstr/yii2-filemanager-widgets#21

@@ -56,7 +56,7 @@ public function behaviors()
'upload' => ['POST'],
'resolve-permissions' => ['POST'],
'change-permissions' => ['POST'],
'search' => ['GET']
'search' => ['GET', 'POST']
Copy link
Member

Choose a reason for hiding this comment

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

Why is POST allowed for search? It actually doesn't change anything on the server.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, doesn't change anything. But using POST for such requests is valid, it would only be a problem the other way round, i.e. if we were to allow GET for non-idempotent requests.

By the way: for the list action, which also writes nothing, only POST is allowed ;-)

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.

2 participants