-
Notifications
You must be signed in to change notification settings - Fork 72
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
Incorrect validation on update node #66
Comments
Do you have any code samples that I can take a look at? |
From basically a fresh install, using ts-node, typescript (latest), dotenv, and neode: import neode from "neode";
const instance = neode.fromEnv();
instance.model("Test", {
test_id: {
primary: true,
type: "string",
required: true
},
name: {
type: "string"
},
isTest: {
type: "boolean",
required: false
}
});
let run = async () => {
const model = instance.model("Test");
let node = await model.create({
test_id: "node.test.1",
name: "Test Node",
isTest: true
});
let updatedNode = await node.update({
name: "Test Node Updated"
});
await updatedNode.delete();
console.debug("Node deleted.");
};
run(); |
This is what I did to update node while skipping validation check. |
adam-cowley
pushed a commit
that referenced
this issue
Oct 8, 2019
…erty throws a validation error - Closes #66
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update functions throw a validation error if the values which are being updated doesn't include the properties marked as required in the model. For eg. property a,b are marked as required, then while updating property c, update function throws validation error for a and b as they are marked as required in the model, here I don't wish to update a and b.
The text was updated successfully, but these errors were encountered: