mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
refactor: remove useless params in setValue method
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user