mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Remove unused helper function formatTitleCaseGeneral
This commit is contained in:
@@ -12,11 +12,7 @@ import {
|
|||||||
BaseSalesOrder,
|
BaseSalesOrder,
|
||||||
Marketing,
|
Marketing,
|
||||||
} from '@/types/api/marketing/marketing';
|
} from '@/types/api/marketing/marketing';
|
||||||
import {
|
import { formatDate, formatTitleCase } from '@/lib/helper';
|
||||||
formatDate,
|
|
||||||
formatTitleCase,
|
|
||||||
formatTitleCaseGeneral,
|
|
||||||
} from '@/lib/helper';
|
|
||||||
|
|
||||||
type MarketingSchemaType = {
|
type MarketingSchemaType = {
|
||||||
customer_id: number | undefined;
|
customer_id: number | undefined;
|
||||||
@@ -123,7 +119,7 @@ export const SalesProductToFieldValues = (
|
|||||||
marketing_type: product.marketing_type
|
marketing_type: product.marketing_type
|
||||||
? {
|
? {
|
||||||
value: product.marketing_type,
|
value: product.marketing_type,
|
||||||
label: formatTitleCaseGeneral(product.marketing_type),
|
label: formatTitleCase(product.marketing_type),
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
convertion_unit: product.convertion_unit
|
convertion_unit: product.convertion_unit
|
||||||
|
|||||||
@@ -38,14 +38,6 @@ export const safeRound = (num: number, decimals: number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const formatTitleCase = (value: string) => {
|
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
|
return value
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/_/g, ' ')
|
.replace(/_/g, ' ')
|
||||||
|
|||||||
Reference in New Issue
Block a user