Skip to content

Request the environment include when fetching domains - #280

Open
jigar-dhulla wants to merge 1 commit into
laravel:mainfrom
jigar-dhulla:request-environment-include-for-domains
Open

jigar-dhulla wants to merge 1 commit into
laravel:mainfrom
jigar-dhulla:request-environment-include-for-domains

Conversation

@jigar-dhulla

Copy link
Copy Markdown

The API only returns a relationship when the request names it in include (same cause as #276). domain:get and domain:list never asked for environment, so environmentId was always null. Domains now request it by default, and a test covers both get and list.

Related to #279. This fixes environmentId only. environment:get already requests primaryDomain by default, and domains is not in the environment endpoint's documented include values, so domainIds is still empty. That part needs the API to allow include=domains, or the CLI to fill it from the domain list.

@jigar-dhulla

Copy link
Copy Markdown
Author

I checked this against the live API with real calls (read-only, one domain attached to one environment). The include=environment in this PR is what makes the link appear:

Request Result
GET /domains/{id} 200, relationships empty
GET /domains/{id}?include=environment 200, relationships.environment points at the environment, and included has the environment
GET /environments/{id}/domains 200, no environment relationship
GET /environments/{id}/domains?include=environment 200, relationships.environment present

So environmentId stays null today only because the request does not ask for it.

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.

1 participant