Make a helper function for token bars that only store the current value in the DB
This commit is contained in:
parent
de6ded9a39
commit
14b6f85137
2 changed files with 13 additions and 8 deletions
|
|
@ -19,6 +19,17 @@ export function barAttribute(min, initial, max = undefined) {
|
|||
});
|
||||
};
|
||||
|
||||
export function derivedMaximumBar(min, initial) {
|
||||
return new fields.SchemaField({
|
||||
value: new fields.NumberField({
|
||||
min,
|
||||
initial,
|
||||
integer: true,
|
||||
nullable: false,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
export function optionalInteger({min, initial = null, max} = {}) {
|
||||
return new fields.NumberField({
|
||||
min,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue