Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Dash-Cased Parameters to CamelCase in getTasks #83

Closed
Tracked by #43
MrRefactoring opened this issue Jun 23, 2023 · 2 comments · Fixed by #89
Closed
Tracked by #43

Convert Dash-Cased Parameters to CamelCase in getTasks #83

MrRefactoring opened this issue Jun 23, 2023 · 2 comments · Fixed by #89
Assignees
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time help wanted Signals that additional assistance or expertise is needed on a particular issue or feature

Comments

@MrRefactoring
Copy link
Owner

MrRefactoring commented Jun 23, 2023

In the getTasks function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getTasks<T = Models.Pagination<Models.Task>>(
  parameters?: Parameters.GetTasks,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/tasks',
    method: 'GET',
    params: {
      'body-format': parameters?.['body-format'],
      'include-blank-tasks': parameters?.['include-blank-tasks'],
      status: parameters?.status,
      'task-id': parameters?.taskId,
      'space-id': parameters?.spaceId,
      'page-id': parameters?.pageId,
      'blogpost-id': parameters?.['blogpost-id'],
      'created-by': parameters?.['created-by'],
      'assigned-to': parameters?.['assigned-to'],
      'completed-by': parameters?.['completed-by'],
      'created-at-from': parameters?.['created-at-from'],
      'created-at-to': parameters?.['created-at-to'],
      'due-at-from': parameters?.['due-at-from'],
      'due-at-to': parameters?.['due-at-to'],
      'completed-at-from': parameters?.['completed-at-from'],
      'completed-at-to': parameters?.['completed-at-to'],
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getTasks<T = Models.Pagination<Models.Task>>(
  parameters?: Parameters.GetTasks,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/tasks',
    method: 'GET',
    params: {
      'body-format': parameters?.bodyFormat,
      'include-blank-tasks': parameters?.includeBlankTasks,
      status: parameters?.status,
      'task-id': parameters?.taskId,
      'space-id': parameters?.spaceId,
      'page-id': parameters?.pageId,
      'blogpost-id': parameters?.blogpostId,
      'created-by': parameters?.createdBy,
      'assigned-to': parameters?.assignedTo,
      'completed-by': parameters?.completedBy,
      'created-at-from': parameters?.createdAtFrom,
      'created-at-to': parameters?.createdAtTo,
      'due-at-from': parameters?.dueAtFrom,
      'due-at-to': parameters?.dueAtTo,
      'completed-at-from': parameters?.completedAtFrom,
      'completed-at-to': parameters?.completedAtTo,
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}
@MrRefactoring MrRefactoring added this to the Version 2 API support milestone Jun 23, 2023
@MrRefactoring MrRefactoring added enhancement Denotes a suggestion or request aimed at improving or adding new features to the project help wanted Signals that additional assistance or expertise is needed on a particular issue or feature good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time labels Jun 23, 2023
@haiderzaidi07
Copy link

I would love to work on this issue, could I be assigned this?

@MrRefactoring
Copy link
Owner Author

MrRefactoring commented Jun 26, 2023

Hello @haiderzaidi07! Yes, sure, thank you very much for your help! Let’s do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Denotes a suggestion or request aimed at improving or adding new features to the project good first issue Highlights beginner-friendly tasks, ideal for those looking to contribute for the first time help wanted Signals that additional assistance or expertise is needed on a particular issue or feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants