Skip to content

Use named types for API request params #5477

Description

@sosnovsky
 How about we declear types like below so that we can make code easy to read and simple and avoid code duplication?
typeJsonRequestParams={method: 'POST'|'PUT';data: Dict<Serializable>;};typeTextRequestParams={method: 'POST';data: string;contentType: string;};typeGetRequestParams={method: 'GET';data?: UrlParams;};typeDeleteRequestParams={method: 'DELETE';};
params?: JsonRequestParams|TextRequestParams|GetRequestParams|DeleteRequestParams

Originally posted by @ioanmo226 in #5372 (comment)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions