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

fix: validate preference value for newsletter #914

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AmanGIT07
Copy link
Contributor

@AmanGIT07 AmanGIT07 commented Mar 21, 2025

Currently the value for newsletter traits are not being validated. This PR fixes that.

Request:

{
    "bodies": [
        {
            "name": "newsletter",
            "value": "test" // invalid value
        }
    ]
}

Response:

Status code - 400

Body -

{
    "code": 3,
    "message": "invalid value for preference",
    "details": []
}

Copy link

vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 6:43am

@coveralls
Copy link

coveralls commented Mar 21, 2025

Pull Request Test Coverage Report for Build 14028912021

Details

  • 3 of 36 (8.33%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 33.382%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/v1beta1/preferences.go 3 5 60.0%
core/preference/service.go 0 7 0.0%
core/preference/preference.go 0 8 0.0%
core/preference/validator.go 0 16 0.0%
Files with Coverage Reduction New Missed Lines %
core/preference/service.go 1 0.0%
Totals Coverage Status
Change from base Build 14028615747: -0.03%
Covered Lines: 9143
Relevant Lines: 27389

💛 - Coveralls

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.

3 participants