Add missing API types#62797
Conversation
| error?: string | ||
|
|
||
| sentAt: Date | ||
| acceptedAt?: Date |
There was a problem hiding this comment.
If we going parse API response as JSON to TeamInvite (or structure including it), should this and other similar fields be of type string, WDYT?
There was a problem hiding this comment.
Yes, these should be string. This was a mistake on my part.
On the Golang side these are time.Time, which end up getting marshaled as an ISO-8601 string. So the types defined here are just wrong.
When using the GraphQL / Apollo library, IIRC it converts times to Dates automatically. (Or maybe it was an extension or custom configuration step or something?)
Anyways, it seems like we would want these data types to match 100% what is sent across the wire. (And not introduce any shim or wrapper later that will automatically convert string to Date.)
Adds the REST API types for the Team Invites and Team Members sections. This isn't used by anything yet, but will be part of updating the Mange
AuthenticatedCodyManageTeamPagepage to use the API client hook.NOTE: I didn't add this in this PR because I'm trying to tease out my local branch into separate PRs. But here's the relevant update to the
Clienttype, so that you can call the endpoints that read/write these data types.Test Plan
CI/CD