refactor(FE): Remove unused helper function formatTitleCaseGeneral

This commit is contained in:
rstubryan
2026-02-09 17:07:00 +07:00
parent efec9b6265
commit e4e6e563c9
2 changed files with 2 additions and 14 deletions
@@ -12,11 +12,7 @@ import {
BaseSalesOrder,
Marketing,
} from '@/types/api/marketing/marketing';
import {
formatDate,
formatTitleCase,
formatTitleCaseGeneral,
} from '@/lib/helper';
import { formatDate, formatTitleCase } from '@/lib/helper';
type MarketingSchemaType = {
customer_id: number | undefined;
@@ -123,7 +119,7 @@ export const SalesProductToFieldValues = (
marketing_type: product.marketing_type
? {
value: product.marketing_type,
label: formatTitleCaseGeneral(product.marketing_type),
label: formatTitleCase(product.marketing_type),
}
: null,
convertion_unit: product.convertion_unit
-8
View File
@@ -38,14 +38,6 @@ export const safeRound = (num: number, decimals: number) => {
};
export const formatTitleCase = (value: string) => {
return value
.toLowerCase()
.split(' ')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};
export const formatTitleCaseGeneral = (value: string) => {
return value
.toLowerCase()
.replace(/_/g, ' ')