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

Add generateFieldErrorWithKnownKeys function #3

Open
bilgeyucel opened this issue Nov 26, 2019 · 0 comments
Open

Add generateFieldErrorWithKnownKeys function #3

bilgeyucel opened this issue Nov 26, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bilgeyucel
Copy link
Contributor

Add generateFieldErrorWithKnownKeys function to use instead of using generateErrorMessage with custom error

const exampleFour = {
  type: "ValidationError",
  detail: {
    password: ["Password is too short", "Please use only letters and numbers"],
    message: {
      body: ["Message body is missing"],
      attachment: ["Attachment is missing"]
    }
  },
  fallback_message: "This is a random fallback message"
};
generateFieldErrorWithKnownKeys("message", knownErrorKeys:["body"]) // ["Attachment is missing"]
@bilgeyucel bilgeyucel added the enhancement New feature or request label Nov 26, 2019
@bilgeyucel bilgeyucel self-assigned this Nov 26, 2019
@bilgeyucel bilgeyucel changed the title Add getFieldErrorWithKnownKeys function Add generateFieldErrorWithKnownKeys function Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants