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

Shorten method name for OPTIONS and DELETE #588

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

Nikhil569
Copy link
Contributor

fixes #584

The fix shorten the method name to only starting 3 characters which have length greater than 5

Below is the screenshot for how it looks

fix584

@helloanoop
Copy link
Contributor

@Nikhil569

<span className="uppercase">
  {item.request.method.length > 5 ? item.request.method.substring(0, 3) : item.request.method}
</span>

I know this fixes the issue, but imo the code does not imply what is being done.

Can you update the PR with something like this

const shortenMethod = (method) => {
  method = method.toLowerCase();

  switch(method) {
    case 'delete':
      return 'DEL';
    case 'options':
      return 'OPT';
    
    default:
      return method;
  }
}

In a large scale project like Bruno, readability of code trumps over number of lines needed to achieve the task.

@helloanoop helloanoop added this to the v1 milestone Oct 18, 2023
@helloanoop helloanoop merged commit caa0a22 into usebruno:main Aug 23, 2024
1 check passed
@helloanoop
Copy link
Contributor

Sorry for the long wait on this.
Merged! Thank you @Nikhil569 !

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

Successfully merging this pull request may close these issues.

Http Method Shorthand in UI
2 participants