ts
interface param {
capacity: number,
typeId?: string
}
const finish = (param: param, _n: number = 1) => {
editList.typeId || editList.typeId > -1 ? param.typeId = editList.typeId : _n = 0;
[promise1, promise2][_n](param).then(res => endTooltip(res))
}
const endTooltip = ({ status, reasonPhrase }: any, callback: Function = () => {
}) => callback?.()
js
const finish = (param, _n = 1) => {
editList.typeId || editList.typeId > -1 ? param.typeId = editList.typeId : _n = 0;
[promise1, promise2][_n](param).then(res => endTooltip(res))
}
const endTooltip = ({ status, reasonPhrase }, callback = () => {
}) => callback?.()