Commit 3ce4a255 authored by luofangping's avatar luofangping

fix:useStock字段问题

parent 2d11d900
......@@ -208,8 +208,11 @@ var ActivityConfigService = /** @class */ (function () {
case 3:
isEditPrize = bothIds.includes(allPrizeList[i]._id);
if (!isEditPrize) return [3 /*break*/, 5];
if (allPrizeList[i].switchStock === constants_1.STOCK_TYPE.LIMIT) {
allPrizeList[i].useStock ? delete allPrizeList[i].useStock : '';
if (allPrizeList[i].switchStock === constants_1.STOCK_TYPE.NO_LIMIT) {
allPrizeList[i].useStock = 0;
}
else if (allPrizeList[i].switchStock === constants_1.STOCK_TYPE.LIMIT) {
(allPrizeList[i].useStock || allPrizeList[i].useStock === 0) && delete allPrizeList[i].useStock;
}
return [4 /*yield*/, this.updateOnePrizeById(allPrizeList[i]._id, allPrizeList[i])];
case 4:
......
......@@ -119,8 +119,10 @@ export default class ActivityConfigService {
// 更新的奖品
const isEditPrize = bothIds.includes(allPrizeList[i]._id)
if (isEditPrize) {
if (allPrizeList[i].switchStock === STOCK_TYPE.LIMIT) {
allPrizeList[i].useStock ? delete allPrizeList[i].useStock : ''
if (allPrizeList[i].switchStock === STOCK_TYPE.NO_LIMIT) {
allPrizeList[i].useStock = 0;
} else if (allPrizeList[i].switchStock === STOCK_TYPE.LIMIT) {
(allPrizeList[i].useStock || allPrizeList[i].useStock ===0) && delete allPrizeList[i].useStock;
}
const editResult = await this.updateOnePrizeById(allPrizeList[i]._id, allPrizeList[i])
if (editResult) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment