Make a helper function for token bars that only store the current value in the DB

This commit is contained in:
Oliver-Akins 2025-02-22 18:38:57 -07:00
parent de6ded9a39
commit 14b6f85137
2 changed files with 13 additions and 8 deletions

View file

@ -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,