You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#55)
Fixes#53
---
<details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary>
> ## 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`.
>
> ```diff
> - 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.
</details>
Description
Placing default parameters before non-default ones waste its benefits since they must be provided to get to the non-default parameters.
Occurrences
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource → app.deepsource.com/gh/Discord-InterChat/InterChat/issue/JS-0302/occurrences/
The text was updated successfully, but these errors were encountered: