Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Conversation

@dev-737
Copy link
Member

@dev-737 dev-737 commented Mar 12, 2024

Fixes #53


Generated summary (powered by Graphite)

TL;DR

This pull request swaps the order of the guildId and roleId parameters in the modifyUserRole function in Utils.ts.

What changed

In the modifyUserRole function, the guildId parameter was previously set to default to SUPPORT_SERVER_ID if no value was provided. This parameter was placed before the roleId parameter. This order has been swapped in this pull request, so now roleId comes before guildId.

-  guildId: Snowflake = SUPPORT_SERVER_ID,
   roleId: Snowflake,
+  guildId: Snowflake = SUPPORT_SERVER_ID,

How to test

To test this change, call the modifyUserRole function with various combinations of parameters. Ensure that the function behaves as expected when guildId is not provided, and that it correctly uses the provided roleId.

Why make this change

This change improves the readability and usability of the modifyUserRole function. By placing the roleId parameter before the guildId parameter, it is clearer that roleId is a required parameter, while guildId is optional and will default to SUPPORT_SERVER_ID if not provided. This makes the function easier to use and understand.

@dev-737 dev-737 mentioned this pull request Mar 12, 2024
Copy link
Member Author

dev-737 commented Mar 12, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @dev-737 and the rest of your teammates on Graphite Graphite

@dev-737 dev-737 added the refactor something that needs a code refactor label Mar 12, 2024 — with Graphite App
@dev-737 dev-737 self-assigned this Mar 12, 2024
@dev-737 dev-737 linked an issue Mar 12, 2024 that may be closed by this pull request
@dev-737 dev-737 force-pushed the 03-12-chore_add_dockerfile_and_pm2 branch from 2bf40fb to 093962d Compare March 14, 2024 09:09
@dev-737 dev-737 force-pushed the 03-12-fix_utils_default_parameters_should_be_placed_after_non-default_ones branch from 1e6ed1e to 2e351f2 Compare March 14, 2024 09:09
@deepsource-io
Copy link

deepsource-io bot commented Mar 14, 2024

Here's the code health analysis summary for commits 1a45f96..a4328e8. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
🎯 1 occurence resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@dev-737 dev-737 force-pushed the 03-12-fix_utils_default_parameters_should_be_placed_after_non-default_ones branch from 2e351f2 to 9f2b97e Compare March 15, 2024 05:07
@dev-737 dev-737 force-pushed the 03-12-chore_add_dockerfile_and_pm2 branch 7 times, most recently from ee00a36 to 4db954f Compare March 16, 2024 17:40
Copy link
Member Author

dev-737 commented Mar 17, 2024

Merge activity

  • Mar 17, 12:03 AM EDT: @dev-737 started a stack merge that includes this pull request via Graphite.
  • Mar 17, 12:04 AM EDT: Graphite couldn't merge this PR because it had conflicts with the trunk branch.

@dev-737 dev-737 changed the base branch from 03-12-chore_add_dockerfile_and_pm2 to main March 17, 2024 04:03
@dev-737 dev-737 merged commit 17e9900 into main Mar 17, 2024
@dev-737 dev-737 deleted the 03-12-fix_utils_default_parameters_should_be_placed_after_non-default_ones branch March 17, 2024 04:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactor something that needs a code refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(JS-0302) Default parameters should be placed after non-default ones

2 participants