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

feat: api suffix to all api function names #4065

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

warmthsea
Copy link
Contributor

@warmthsea warmthsea commented Aug 7, 2024

Description

api 函数相比普通的函数较为特殊,虽然有 import 上下文引用,但是不太容易与普通函数做区分
实现 #4058

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Enhanced clarity in API function names across various modules by appending "Api" to identifiers, such as login, getAccessCodes, and getUserInfo.
  • Bug Fixes

    • No functional changes; all renamed functions maintain existing functionality while improving naming conventions.
  • Documentation

    • Updated documentation to reflect changes in API function names, ensuring consistency and clarity in user operations (e.g., getUserInfoApi, saveUserApi, and deleteUserApi).

@warmthsea warmthsea requested review from anncwb, vince292007 and a team as code owners August 7, 2024 03:17
Copy link

changeset-bot bot commented Aug 7, 2024

⚠️ No Changeset found

Latest commit: efc9b8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Walkthrough

This update primarily focuses on enhancing the clarity of API function names across multiple files in the project. Several functions related to authentication, user information, menu retrieval, and status checks have been renamed to include the "Api" suffix. These changes improve code readability and maintainability without altering the underlying functionality. Import statements and calls have also been updated accordingly to reflect these new names.

Changes

Files Grouped Change Summary
apps/web-antd/src/api/core/auth.ts, apps/web-ele/src/api/core/auth.ts, apps/web-naive/src/api/core/auth.ts Renamed functions: login to loginApi, getAccessCodes to getAccessCodesApi.
apps/web-antd/src/api/core/menu.ts, apps/web-ele/src/api/core/menu.ts, apps/web-naive/src/api/core/menu.ts Renamed function: getAllMenus to getAllMenusApi.
apps/web-antd/src/api/core/user.ts, apps/web-ele/src/api/core/user.ts, apps/web-naive/src/api/core/user.ts Renamed function: getUserInfo to getUserInfoApi.
apps/web-antd/src/api/demos/status.ts Renamed function: getMockStatus to getMockStatusApi.
apps/web-antd/src/router/access.ts, apps/web-ele/src/router/access.ts, apps/web-naive/src/router/access.ts Updated imports and calls from getAllMenus to getAllMenusApi.
apps/web-antd/src/store/auth.ts, apps/web-ele/src/store/auth.ts, apps/web-naive/src/store/auth.ts Updated imports and calls for getAccessCodes, getUserInfo, and login to their new names with "Api".
docs/src/guide/essentials/server.md Renamed functions: getUserInfo to getUserInfoApi, saveUser to saveUserApi, deleteUser to deleteUserApi.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthAPI
    User->>AuthAPI: login(data)
    AuthAPI->>AuthAPI: validate credentials
    AuthAPI-->>User: return tokens
Loading
sequenceDiagram
    participant User
    participant MenuAPI
    User->>MenuAPI: getAllMenus()
    MenuAPI-->>User: return menu items
Loading

🐇
In the code where rabbits hop,
Functions now have names that pop!
Names with "Api" pave the way,
Clear and bright, like sunny day.
Hooray for changes, let’s all cheer,
Readability is now so near! 🥕


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 891fd80 and efc9b8d.

Files selected for processing (18)
  • apps/web-antd/src/api/core/auth.ts (1 hunks)
  • apps/web-antd/src/api/core/menu.ts (1 hunks)
  • apps/web-antd/src/api/core/user.ts (1 hunks)
  • apps/web-antd/src/api/demos/status.ts (1 hunks)
  • apps/web-antd/src/router/access.ts (2 hunks)
  • apps/web-antd/src/store/auth.ts (4 hunks)
  • apps/web-antd/src/views/demos/features/login-expired/index.vue (1 hunks)
  • apps/web-ele/src/api/core/auth.ts (1 hunks)
  • apps/web-ele/src/api/core/menu.ts (1 hunks)
  • apps/web-ele/src/api/core/user.ts (1 hunks)
  • apps/web-ele/src/router/access.ts (2 hunks)
  • apps/web-ele/src/store/auth.ts (4 hunks)
  • apps/web-naive/src/api/core/auth.ts (1 hunks)
  • apps/web-naive/src/api/core/menu.ts (1 hunks)
  • apps/web-naive/src/api/core/user.ts (1 hunks)
  • apps/web-naive/src/router/access.ts (2 hunks)
  • apps/web-naive/src/store/auth.ts (4 hunks)
  • docs/src/guide/essentials/server.md (3 hunks)
Files skipped from review due to trivial changes (11)
  • apps/web-antd/src/api/core/auth.ts
  • apps/web-antd/src/api/core/user.ts
  • apps/web-antd/src/api/demos/status.ts
  • apps/web-antd/src/views/demos/features/login-expired/index.vue
  • apps/web-ele/src/api/core/auth.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-ele/src/api/core/user.ts
  • apps/web-ele/src/store/auth.ts
  • apps/web-naive/src/api/core/menu.ts
  • apps/web-naive/src/api/core/user.ts
  • apps/web-naive/src/store/auth.ts
Additional comments not posted (16)
apps/web-antd/src/api/core/menu.ts (1)

8-8: LGTM! But verify the function usage in the codebase.

The change to rename getAllMenus to getAllMenusApi is clear and improves clarity.

However, ensure that all function calls to getAllMenus are updated to getAllMenusApi.

Verification successful

Function renaming verified successfully.

All instances of getAllMenus have been updated to getAllMenusApi throughout the codebase.

  • apps/web-ele/src/api/core/menu.ts
  • apps/web-ele/src/router/access.ts
  • apps/web-naive/src/router/access.ts
  • apps/web-naive/src/api/core/menu.ts
  • apps/web-antd/src/router/access.ts
  • apps/web-antd/src/api/core/menu.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenus'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type js --type ts -A 5 'getAllMenus'

Length of output: 3117

apps/web-naive/src/api/core/auth.ts (2)

31-31: LGTM! But verify the function usage in the codebase.

The change to rename getAccessCodes to getAccessCodesApi is clear and improves clarity.

However, ensure that all function calls to getAccessCodes are updated to getAccessCodesApi.

Verification successful

All instances of getAccessCodes have been successfully updated to getAccessCodesApi.

The function name change has been correctly propagated across the codebase.

  • apps/web-naive/src/store/auth.ts
  • apps/web-ele/src/store/auth.ts
  • apps/web-antd/src/store/auth.ts
  • apps/web-naive/src/api/core/auth.ts
  • apps/web-ele/src/api/core/auth.ts
  • apps/web-antd/src/api/core/auth.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodes` are updated to `getAccessCodesApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAccessCodes'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodes` are updated to `getAccessCodesApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 $'getAccessCodes'

Length of output: 2906


24-24: LGTM! But verify the function usage in the codebase.

The change to rename login to loginApi is clear and improves clarity.

However, ensure that all function calls to login are updated to loginApi.

Verification successful

All instances of the login function have been successfully updated to loginApi.

The search results confirm that there are no remaining calls to the old login function, and all relevant instances have been updated to loginApi.

  • Instances found:
    • apps/web-antd/src/store/auth.ts
    • apps/web-ele/src/store/auth.ts
    • apps/web-naive/src/store/auth.ts
    • apps/web-antd/src/api/core/auth.ts
    • apps/web-ele/src/api/core/auth.ts
    • apps/web-naive/src/api/core/auth.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `login` are updated to `loginApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'login'

Length of output: 60


Script:

#!/bin/bash
# Description: Verify all function calls to `login` are updated to `loginApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type typescript -A 5 $'login'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify all function calls to `login` are updated to `loginApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg -A 5 $'login'

Length of output: 49659


Script:

#!/bin/bash
# Description: Verify all function calls to `login` are updated to `loginApi`.

# Test: Search for the function calls. Expect: Only occurrences of the new name.
rg '\blogin\('

Length of output: 16


Script:

#!/bin/bash
# Description: Verify all function calls to `login` are updated to `loginApi`.

# Test: Search for the function calls to both `login` and `loginApi`.
rg '\b(login|loginApi)\('

Length of output: 612

apps/web-naive/src/router/access.ts (2)

9-9: LGTM! But verify the function usage in the codebase.

The change to rename getAllMenus to getAllMenusApi in the import statement is clear and improves clarity.

However, ensure that all function calls to getAllMenus are updated to getAllMenusApi.

Verification successful

Function usage updated successfully

All instances of getAllMenus have been updated to getAllMenusApi in the codebase. The import statements and function calls reflect the new name.

  • apps/web-ele/src/router/access.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-antd/src/router/access.ts
  • apps/web-antd/src/api/core/menu.ts
  • apps/web-naive/src/router/access.ts
  • apps/web-naive/src/api/core/menu.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenus'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Search for the function usage in TypeScript files. Expect: Only occurrences of the new name.
rg --type ts -A 5 'getAllMenus'

Length of output: 3107


30-30: LGTM! But verify the function usage in the codebase.

The change to rename getAllMenus to getAllMenusApi in the function call is clear and improves clarity.

However, ensure that all function calls to getAllMenus are updated to getAllMenusApi.

Verification successful

Verification successful: All instances of getAllMenus have been updated to getAllMenusApi.

The search results confirm that all occurrences of getAllMenus have been updated to getAllMenusApi across the relevant files.

  • apps/web-ele/src/router/access.ts
  • apps/web-antd/src/router/access.ts
  • apps/web-naive/src/router/access.ts
  • apps/web-antd/src/api/core/menu.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-naive/src/api/core/menu.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenus'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenus` are updated to `getAllMenusApi`.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 'getAllMenus'

Length of output: 3107

apps/web-ele/src/router/access.ts (2)

32-32: LGTM! But verify the function usage in the codebase.

The function call change is consistent with the new naming convention.

However, ensure that all function calls to getAllMenusApi are updated correctly in the codebase.

Verification successful

All function calls to getAllMenusApi are consistent with the new naming convention.

  • apps/web-naive/src/router/access.ts
  • apps/web-ele/src/router/access.ts
  • apps/web-antd/src/router/access.ts
  • apps/web-naive/src/api/core/menu.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-antd/src/api/core/menu.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenusApi'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type js --type ts -A 5 'getAllMenusApi'

Length of output: 3120


11-11: LGTM! But verify the function usage in the codebase.

The import statement change is consistent with the new naming convention.

However, ensure that all function calls to getAllMenusApi are updated correctly in the codebase.

Verification successful

Verification Successful: Function usage updated correctly

The function getAllMenusApi is consistently used across the codebase:

  • apps/web-antd/src/router/access.ts
  • apps/web-antd/src/api/core/menu.ts
  • apps/web-ele/src/router/access.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-naive/src/router/access.ts
  • apps/web-naive/src/api/core/menu.ts

All instances have been updated to the new naming convention. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenusApi'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type typescript -A 5 'getAllMenusApi'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg -A 5 'getAllMenusApi'

Length of output: 3100

apps/web-antd/src/router/access.ts (2)

32-32: LGTM! But verify the function usage in the codebase.

The function call change is consistent with the new naming convention.

However, ensure that all function calls to getAllMenusApi are updated correctly in the codebase.

Verification successful

All function calls to getAllMenusApi are updated correctly in the codebase.

The function usage is consistent with the new naming convention across the relevant files:

  • apps/web-naive/src/router/access.ts
  • apps/web-ele/src/router/access.ts
  • apps/web-antd/src/router/access.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenusApi'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type js --type ts -A 5 'getAllMenusApi'

Length of output: 3120


11-11: LGTM! But verify the function usage in the codebase.

The import statement change is consistent with the new naming convention.

However, ensure that all function calls to getAllMenusApi are updated correctly in the codebase.

Verification successful

The function usage has been successfully updated across the codebase.

The import statements and function calls for getAllMenusApi have been updated correctly in the following files:

  • apps/web-ele/src/router/access.ts
  • apps/web-antd/src/router/access.ts
  • apps/web-naive/src/router/access.ts
  • apps/web-antd/src/api/core/menu.ts
  • apps/web-ele/src/api/core/menu.ts
  • apps/web-naive/src/api/core/menu.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAllMenusApi'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type typescript -A 5 'getAllMenusApi'
rg --type javascript -A 5 'getAllMenusApi'

Length of output: 155


Script:

#!/bin/bash
# Description: Verify all function calls to `getAllMenusApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 'getAllMenusApi'
rg --type js -A 5 'getAllMenusApi'

Length of output: 3145

apps/web-antd/src/store/auth.ts (4)

47-47: LGTM! But verify the function usage in the codebase.

The function call change is consistent with the new naming convention.

However, ensure that all function calls to getAccessCodesApi are updated correctly in the codebase.

Verification successful

Function usage verified!

The function getAccessCodesApi has been correctly renamed and used consistently across the codebase. The following files were checked and confirmed:

  • apps/web-ele/src/store/auth.ts
  • apps/web-naive/src/store/auth.ts
  • apps/web-antd/src/store/auth.ts
  • apps/web-naive/src/api/core/auth.ts
  • apps/web-ele/src/api/core/auth.ts
  • apps/web-antd/src/api/core/auth.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodesApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getAccessCodesApi'

Length of output: 72


Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodesApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 'getAccessCodesApi'

Length of output: 2909


36-36: LGTM! But verify the function usage in the codebase.

The function call change is consistent with the new naming convention.

However, ensure that all function calls to loginApi are updated correctly in the codebase.

Verification successful

Function usage verified successfully.

The function call to loginApi has been updated correctly and is consistently used across the codebase.

  • apps/web-naive/src/store/auth.ts
  • apps/web-antd/src/store/auth.ts
  • apps/web-ele/src/store/auth.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `loginApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'loginApi'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify all function calls to `loginApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type typescript -A 5 $'loginApi'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify all function calls to `loginApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 $'loginApi'

Length of output: 3632


13-13: LGTM! But verify the function usage in the codebase.

The import statement changes are consistent with the new naming convention.

However, ensure that all function calls to getAccessCodesApi, getUserInfoApi, and loginApi are updated correctly in the codebase.

Verification successful

Let's re-run the verification scripts with the correct file type to ensure that all function calls to getAccessCodesApi, getUserInfoApi, and loginApi are updated correctly in the codebase.


LGTM! The function usage is correctly updated.

The import statement changes are consistent with the new naming convention, and all function calls to getAccessCodesApi, getUserInfoApi, and loginApi are updated correctly in the codebase.

  • apps/web-antd/src/store/auth.ts
  • apps/web-ele/src/store/auth.ts
  • apps/web-naive/src/store/auth.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodesApi`, `getUserInfoApi`, and `loginApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new names.
rg --type python -A 5 $'getAccessCodesApi'
rg --type python -A 5 $'getUserInfoApi'
rg --type python -A 5 $'loginApi'

Length of output: 206


Script:

#!/bin/bash
# Description: Verify all function calls to `getAccessCodesApi`, `getUserInfoApi`, and `loginApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new names.
rg --type js -A 5 'getAccessCodesApi'
rg --type js -A 5 'getUserInfoApi'
rg --type js -A 5 'loginApi'

rg --type ts -A 5 'getAccessCodesApi'
rg --type ts -A 5 'getUserInfoApi'
rg --type ts -A 5 'loginApi'

Length of output: 9533


95-95: LGTM! But verify the function usage in the codebase.

The function call change is consistent with the new naming convention.

However, ensure that all function calls to getUserInfoApi are updated correctly in the codebase.

Verification successful

Function usage verified!

The getUserInfoApi function is correctly used across the codebase, aligning with the new naming convention.

  • apps/web-antd/src/store/auth.ts
  • apps/web-ele/src/store/auth.ts
  • apps/web-naive/src/store/auth.ts
  • Corresponding API files
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getUserInfoApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type python -A 5 $'getUserInfoApi'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all function calls to `getUserInfoApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type typescript -A 5 'getUserInfoApi'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `getUserInfoApi` match the new naming convention.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 'getUserInfoApi'

Length of output: 2888

docs/src/guide/essentials/server.md (3)

130-138: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to saveUserApi match the new name.


120-120: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to getUserInfoApi match the new name.

Verification successful

Verification Successful: The function getUserInfoApi has been correctly renamed and utilized throughout the codebase.

  • The function getUserInfoApi is consistently used in the following files:
    • apps/web-ele/src/store/auth.ts
    • apps/web-naive/src/store/auth.ts
    • apps/web-antd/src/store/auth.ts
  • The function definition is correctly updated in:
    • apps/web-ele/src/api/core/user.ts
    • apps/web-antd/src/api/core/user.ts
    • apps/web-naive/src/api/core/user.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `getUserInfoApi` match the new name.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 $'getUserInfoApi'

Length of output: 2888


153-153: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to deleteUserApi match the new name.

Verification successful

No further action needed: The function deleteUserApi is not used elsewhere in the codebase.

The function deleteUserApi is defined in docs/src/guide/essentials/server.md and there are no other occurrences of deleteUserApi or deleteUser in the codebase. This suggests that the function is either new and not yet integrated or it is a documentation example.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `deleteUserApi` match the new name.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type ts -A 5 $'deleteUserApi'

Length of output: 33


Script:

#!/bin/bash
# Description: Verify all function calls to `deleteUserApi` and `deleteUser` match the new name.

# Test: Search for the new function name `deleteUserApi` across all file types.
rg -A 5 'deleteUserApi'

# Test: Search for the old function name `deleteUser` across all file types to ensure it has been fully replaced.
rg -A 5 'deleteUser'

Length of output: 748

@vince292007 vince292007 merged commit 08391ad into vbenjs:main Aug 7, 2024
17 of 18 checks passed
@warmthsea warmthsea deleted the refactor/api-name branch August 7, 2024 05:45
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants