refactor: update storage quota configuration from megabytes to gigabytes

This commit is contained in:
Yashwin 2026-05-12 15:50:17 +05:30
parent 4024711100
commit eefd4f995a

View File

@ -4,7 +4,6 @@ import {
ShieldCheck,
Building2,
Package,
// AlertCircle,
Pencil,
HardDrive,
Files,
@ -58,12 +57,13 @@ const QuotaEditModal = ({
quota,
onUpdated,
}: QuotaEditModalProps) => {
const [maxStorageMB, setMaxStorageMB] = useState(
const [maxStorageGB, setMaxStorageGB] = useState(
Math.floor(
(typeof quota.max_storage_bytes === "string"
? parseInt(quota.max_storage_bytes)
: quota.max_storage_bytes) /
1024 /
1024 /
1024,
),
);
@ -76,7 +76,7 @@ const QuotaEditModal = ({
setIsUpdating(true);
try {
await fileAttachmentService.updateQuota({
max_storage_bytes: maxStorageMB * 1024 * 1024,
max_storage_bytes: maxStorageGB * 1024 * 1024 * 1024,
max_file_size_bytes: maxFileMB * 1024 * 1024,
});
onUpdated();
@ -114,11 +114,11 @@ const QuotaEditModal = ({
>
<div className="p-6 space-y-5">
<FormField
label="Max Total Storage (MB)"
label="Max Total Storage (GB)"
type="number"
value={maxStorageMB}
onChange={(e) => setMaxStorageMB(parseInt(e.target.value) || 0)}
placeholder="e.g. 10240 for 10GB"
value={maxStorageGB}
onChange={(e) => setMaxStorageGB(parseInt(e.target.value) || 0)}
placeholder="e.g. 10 for 10GB"
/>
<FormField
label="Max Per-File Size (MB)"