mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
address rabbit's comments.
This commit is contained in:
@@ -199,14 +199,20 @@ function generateSingleValue(
|
||||
case 'integer': {
|
||||
const intAttr = column as Models.ColumnInteger;
|
||||
const min = isWithinSafeRange(intAttr.min) ? intAttr.min : 0;
|
||||
const max = isWithinSafeRange(intAttr.max) ? intAttr.max : Math.max(min + 100, 100);
|
||||
const fallbackMax = Math.max(min + 100, 100);
|
||||
const max = isWithinSafeRange(intAttr.max)
|
||||
? intAttr.max
|
||||
: Math.min(fallbackMax, Number.MAX_SAFE_INTEGER);
|
||||
return faker.number.int({ min, max });
|
||||
}
|
||||
|
||||
case 'double': {
|
||||
const floatAttr = column as Models.ColumnFloat;
|
||||
const min = isWithinSafeRange(floatAttr.min) ? floatAttr.min : 0;
|
||||
const max = isWithinSafeRange(floatAttr.max) ? floatAttr.max : Math.max(min + 100, 100);
|
||||
const fallbackMax = Math.max(min + 100, 100);
|
||||
const max = isWithinSafeRange(floatAttr.max)
|
||||
? floatAttr.max
|
||||
: Math.min(fallbackMax, Number.MAX_SAFE_INTEGER);
|
||||
const precision = 4;
|
||||
|
||||
return faker.number.float({ min, max, fractionDigits: precision });
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
let showDelete = $state(false);
|
||||
let showOverview = $state(false);
|
||||
|
||||
let columns = $state([
|
||||
let columns = $derived([
|
||||
{ id: 'key', width: { min: $isSmallViewport ? 250 : 200 }, resizable: false },
|
||||
{ id: 'type', width: 120, resizable: false },
|
||||
{ id: 'columns', width: { min: 200 }, resizable: false },
|
||||
|
||||
Reference in New Issue
Block a user