update nice visuel

This commit is contained in:
gpatruno
2026-07-25 20:04:34 +02:00
parent 3a8871cbae
commit 810e4ac922
78 changed files with 6742 additions and 3116 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import { api, formatCredits } from '../api';
import { api, formatCredits, centsJson, toCentsBigInt } from '../api';
import ImageField from './ImageField';
const emptyCase = { name: '', price: 100, imageUrl: '', active: true };
@@ -62,7 +62,7 @@ export default function AdminCases() {
e.preventDefault();
setError('');
try {
await api.createCase({ ...caseForm, price: Number(caseForm.price) });
await api.createCase({ ...caseForm, price: centsJson(toCentsBigInt(caseForm.price)) });
setCaseForm(emptyCase);
await load();
} catch (err) {
@@ -112,7 +112,7 @@ export default function AdminCases() {
try {
await api.updateCase(editingId, {
name: edit.name,
price: Number(edit.price),
price: centsJson(toCentsBigInt(edit.price)),
imageUrl: edit.imageUrl,
active: edit.active,
});