Skip to content

Add an API (ApiPlatform) #309

Open
Open
@tacman

Description

@tacman

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions