+
Skip to content

Migrate client API to codegen #174

@MichaelJamesParsons

Description

@MichaelJamesParsons

Description

The client app's API client is written by hand. Investigate what it would take to generate an API client from the routes defined the server app's routes.

Requirements/Expected Behavior

Generate an API client that is compatible with React Hooks. It should support the following use cases

Note: The API doesn't necessarily have to be consistent with the examples below.

Call directly from useEffect()

export function MyComponent() {
  useEffect(() => {
      makeTitanApiRequest(ListFileEntryTypes)
        .then(/* do something */);
  });
  return (...);
}

Wrap as a React hook

const fetchUsers = useTitanApiClient(ListOrganizationUsersRequest,
    { orgId: props.organizationId });

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-ChoreIssues related to quality-of-life improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载