Bulk update category order and improve number formatting
Category order is now updated via a bulk API endpoint instead of individual requests, improving efficiency. Number formatting in pricing tiers form now avoids cursor jumping by only formatting decimals when necessary.
This commit is contained in:
@@ -21,7 +21,9 @@ export const PricingTiers = ({
|
||||
handleAddTier,
|
||||
}: PricingTiersProps) => {
|
||||
const formatNumber = (num: number) => {
|
||||
return Number(num.toFixed(2)).toString();
|
||||
// Only format to 2 decimal places if the number has decimal places
|
||||
// This prevents cursor jumping when user types whole numbers
|
||||
return num % 1 === 0 ? num.toString() : num.toFixed(2);
|
||||
};
|
||||
|
||||
const formatTotal = (num: number) => {
|
||||
|
||||
Reference in New Issue
Block a user