Comments (3)
I apologize, I just saw this, could you give an example?
from obey.
@Fluidbyte no worries. thanks for the great lib.
I have a use case where a field is set on creation, and should not be modified afterwards. so would like to have a validation error when user is trying to update.
tho I think I might be able to workaround by using a modifier callback
from obey.
I've been thinking about this and it wouldn't really be possible at the level where Obey resides since it has no inherit knowledge of if data is going through a create or update process. You'd probably be best simply running a check inside the CRUD methods themselves.
from obey.
Related Issues (20)
- Documentation Generator
- Custom methods on model? HOT 4
- Types: array, allow empty HOT 1
- Conditional Requires
- Error for requireIf/requireIfNot related defaults, creators
- New feature request: "equalsTo" validator HOT 3
- initData is not updated HOT 3
- (breaking) change `requireIf`(Not) to `requiredIf`(Not) HOT 1
- Return array data correctly if no `values` specified HOT 1
- 'default' validator doesn't work for booleans
- allowNull: true/default: null overridden if initial val is falsey (but not null)
- Predefined types allow empties without running type validations
- Error messages for invalid nested arrays/objects are useless
- Account for dynamic keys in nested conditional requires
- Using `allow` with `empty` is broken for strings
- Non-string zip codes with leading 0 invalid
- Null value fails with allowNull and no default
- Creators/modifiers that return null values fail with allowNull
- Conditional requires in arrays of objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obey.