Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Return team id when adding team #64

Closed
wants to merge 4 commits into from

Conversation

jonathan-dorsey
Copy link

@jonathan-dorsey jonathan-dorsey commented Oct 4, 2020

This pull request updates the Team code to return the computed id value for newly created teams. This is necessary in support of adding team resource functionality in the terraform provider. See grafana/terraform-provider-grafana#120

Also updated the test to use and validate the newly returned id value. While there, modified the Team code to use a value instead of a pointer. This is more consistent with some of the similar code in org, alert, user...

@jonathan-dorsey
Copy link
Author

@tonglil @mlclmj - I believe this PR is ready for review. To retrieve and return the computed ID value, I followed the same pattern that was used for the organization to be consistent, but let me know if you would prefer something else. If we are worried about introducing a breaking change by adding the second return I could potentially create a separate method to add the team. This might be a better approach anyway, as it could accept a Team struct in the parameters and return a populated Team struct. Doing it that way would avoid changing the function signature any time some new field might be added to the Team in Grafana.

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

Successfully merging this pull request may close these issues.

1 participant