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

Add an API (ApiPlatform) #309

Open
tacman opened this issue Nov 3, 2023 · 1 comment
Open

Add an API (ApiPlatform) #309

tacman opened this issue Nov 3, 2023 · 1 comment

Comments

@tacman
Copy link

tacman commented Nov 3, 2023

Api Platform is a fast and easy way to add an API.

Initially, it's just installing it and setting the class / property attributes. My datatables bundle uses that, so you can replace

        $members = $memberRepository->findByDirectoryCollection($directoryCollection, [
            'limit' => $request->get('length', 100),
            'offset' => $request->get('start', 0),
            'group_by' => $this->getGroupBy($directoryCollection),
            'sort_by' => $this->getSortBy($request),
            'sort_direction' => $this->getSortDirection($request),
        ]);
        $response = $this->buildDataResponse($members);

with a simple call to the API, which already has limit, offset and sorting. It's pretty cool, I think you'll like it. Plus, you get an API out of it!

Can you add it to the main branch and configure it so that the API works? Then I'll merge it with my branch and use it for the datatables (in a separate controller of course, during testing).

@stephenyeargin
Copy link
Member

Interested for sure. I haven't had a ton of time to put into this project (family and work), so it may be a bit before I can jump in on this.

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

No branches or pull requests

2 participants