fix(dashboard): allow to unset currency cell value (#9312)
**What** - unset datagrid currency cell on delete press instead of setting it to 0 - consolidate pricing editors validations - fix PL edit pricing schema --- FIXES CC-529
This commit is contained in:
@@ -12,7 +12,7 @@ type UseDataGridFormHandlersOptions<TData, TFieldValues extends FieldValues> = {
|
||||
|
||||
export const useDataGridFormHandlers = <
|
||||
TData,
|
||||
TFieldValues extends FieldValues
|
||||
TFieldValues extends FieldValues,
|
||||
>({
|
||||
matrix,
|
||||
form,
|
||||
@@ -119,7 +119,7 @@ export function convertArrayToPrimitive(
|
||||
): any[] {
|
||||
switch (type) {
|
||||
case "number":
|
||||
return values.map(convertToNumber)
|
||||
return values.map((v) => (v === "" ? v : convertToNumber(v)))
|
||||
case "boolean":
|
||||
return values.map(convertToBoolean)
|
||||
case "text":
|
||||
|
||||
Reference in New Issue
Block a user