Skip to content

validate.js require method doesn't work for attributes whose value is evaluated to false #3

@marianoguerra

Description

@marianoguerra

the line 22 of validate contains the following

if (!newDoc[field]) forbidden(message);

that means that if the field evalueates to false (like 0, 0.0, "" or false) then it will return forbidden

the line should be

if (typeof(newDoc[field]) === "undefined") forbidden(message);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions