refactor: remove useless params in setValue method

This commit is contained in:
QiShaoXuan
2022-08-03 19:21:30 +08:00
parent c347878f23
commit 503752ce00
3 changed files with 12 additions and 26 deletions

View File

@@ -92,8 +92,7 @@ export const useOnCreateSure = ({ block }: { block: AsyncBlock }) => {
type: newProperty.type,
value: selectedId,
} as SelectValue | MultiSelectValue | StatusValue,
recastBlock.id,
newProperty.id
recastBlock.id
);
} else if (type === PendantTypes.Information) {
const emailOptions = genOptionWithId(newPropertyItem.emailOptions);
@@ -137,8 +136,7 @@ export const useOnCreateSure = ({ block }: { block: AsyncBlock }) => {
}),
},
} as InformationValue,
recastBlock.id,
newProperty.id
recastBlock.id
);
} else {
// TODO: Color and background should use pendant config, but ui is not design now
@@ -158,8 +156,7 @@ export const useOnCreateSure = ({ block }: { block: AsyncBlock }) => {
type: newProperty.type,
value: newValue,
} as TextValue | DateValue,
recastBlock.id,
newProperty.id
recastBlock.id
);
}
};
@@ -236,8 +233,7 @@ export const useOnUpdateSure = ({
type: selectProperty.type,
value: selectedId,
} as SelectValue | MultiSelectValue | StatusValue,
recastBlock.id,
selectProperty.id
recastBlock.id
);
} else if (type === PendantTypes.Information) {
// const { emailOptions, phoneOptions, locationOptions } =
@@ -295,8 +291,7 @@ export const useOnUpdateSure = ({
}),
},
} as InformationValue,
recastBlock.id,
newProperty.id
recastBlock.id
);
} else {
await setValue(
@@ -305,8 +300,7 @@ export const useOnUpdateSure = ({
type: property.type,
value: newValue,
} as TextValue | DateValue,
recastBlock.id,
property.id
recastBlock.id
);
}

View File

@@ -131,8 +131,7 @@ export const moveCardToGroup = async ({
type: group.type,
value: group.id,
},
recastBlock.id,
groupBy.id
recastBlock.id
);
break;
}
@@ -143,8 +142,7 @@ export const moveCardToGroup = async ({
type: group.type,
value: group.id,
},
recastBlock.id,
groupBy.id
recastBlock.id
);
break;
}
@@ -155,8 +153,7 @@ export const moveCardToGroup = async ({
type: group.type,
value: [group.id],
},
recastBlock.id,
groupBy.id
recastBlock.id
);
break;
}
@@ -167,8 +164,7 @@ export const moveCardToGroup = async ({
type: group.type,
value: group.id,
},
recastBlock.id,
groupBy.id
recastBlock.id
);
break;
}

View File

@@ -241,15 +241,11 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
return props[id];
};
const setValue = (
newValue: RecastBlockValue,
recastBlockId: string,
propertyId: RecastPropertyId
) => {
const setValue = (newValue: RecastBlockValue, recastBlockId: string) => {
setHistory({
recastBlockId: recastBlockId,
blockId: block.id,
propertyId: propertyId,
propertyId: newValue.id,
});
return recastItem.setProperty(TABLE_VALUES_KEY, {