Skip to content

Commit 34f958b

Browse files
authored
feat: prefill premium quota in admin users (#19)
1 parent 4ad20ea commit 34f958b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/pages/admin-users.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const tierOptions = [
3434
];
3535

3636
const tierLabelMap = new Map(tierOptions.map((option) => [option.value, option.label]));
37+
const defaultPremiumQuotaText = JSON.stringify(quotas.premium, null, 2);
3738

3839
// JSON Editor wrapper component for quota editing
3940
const JsonEditorWrapper = ({
@@ -131,7 +132,11 @@ export const Component = () => {
131132
status: record.status,
132133
tierExpiresAt: record.tierExpiresAt ? dayjs(record.tierExpiresAt) : null,
133134
});
134-
setQuotaValue(record.quota ? JSON.stringify(record.quota, null, 2) : '');
135+
setQuotaValue(
136+
record.quota
137+
? JSON.stringify(record.quota, null, 2)
138+
: defaultPremiumQuotaText,
139+
);
135140
setIsModalOpen(true);
136141
};
137142

0 commit comments

Comments
 (0)