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

[PLA-2008] fix create collection #173

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

zlayine
Copy link
Contributor

@zlayine zlayine commented Oct 24, 2024

PR Type

Bug fix


Description

  • Fixed the logic for creating the mintPolicy object in the createCollection function by removing unnecessary conditions.
  • Ensured that mintPolicy is always an object, which simplifies the code and potentially fixes issues related to undefined policies.

Changes walkthrough 📝

Relevant files
Bug fix
CreateCollection.vue
Simplify mintPolicy logic in createCollection function     

resources/js/components/pages/create/CreateCollection.vue

  • Removed the hasMintPolicy computed property.
  • Simplified the mintPolicy object creation logic.
  • Ensured mintPolicy is always an object, even if conditions are not
    met.
  • +5/-9     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Simplification
    The removal of conditional logic for mintPolicy simplifies the code and ensures consistency in the object structure, which could improve maintainability and reduce potential bugs related to undefined policies.

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Validate and ensure the boolean nature of forceCollapsingSupply

    Validate the forceCollapsingSupply.value to ensure it is a boolean and handle any
    potential type coercion issues that might arise.

    resources/js/components/pages/create/CreateCollection.vue [506]

    -forceCollapsingSupply: forceCollapsingSupply.value,
    +forceCollapsingSupply: !!forceCollapsingSupply.value,
    Suggestion importance[1-10]: 7

    Why: The suggestion to use !! ensures that forceCollapsingSupply.value is explicitly converted to a boolean, which is a good practice to prevent type coercion issues. This improves code robustness.

    7

    @zlayine zlayine merged commit 1d82bc4 into master Oct 24, 2024
    4 checks passed
    @zlayine zlayine deleted the bugfix/pla-2008/create-collection branch October 24, 2024 08:56
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Development

    Successfully merging this pull request may close these issues.

    2 participants