Auto Submit

pull/1/head
autosubmit 3 years ago
parent aaf1e0b2b6
commit 9ec594ff90

@ -169,31 +169,33 @@ var AddBoard = function AddBoard(_ref) {
},
onFinish: /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(v) {
var _boardsCategoryList$b4, _boardsCategoryList$b5, _boardsCategoryList$b6;
var _v$attachment_ids, _boardsCategoryList$b4, _boardsCategoryList$b5, _boardsCategoryList$b6;
var select_board_id, res, _res$data;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
// v.attachment_ids = v.attachment_ids?.map((v: any) => v.response.id)
v.attachment_ids = (_v$attachment_ids = v.attachment_ids) === null || _v$attachment_ids === void 0 ? void 0 : _v$attachment_ids.map(function (v) {
return v.response.id;
});
select_board_id = boardsCategoryList === null || boardsCategoryList === void 0 ? void 0 : (_boardsCategoryList$b4 = boardsCategoryList.boards) === null || _boardsCategoryList$b4 === void 0 ? void 0 : (_boardsCategoryList$b5 = _boardsCategoryList$b4.filter(function (item) {
return item.name == "未分配目录";
})) === null || _boardsCategoryList$b5 === void 0 ? void 0 : (_boardsCategoryList$b6 = _boardsCategoryList$b5[0]) === null || _boardsCategoryList$b6 === void 0 ? void 0 : _boardsCategoryList$b6.id;
v = objectSpread2_default()(objectSpread2_default()({}, v), {}, {
select_board_id: select_board_id
});
_context.next = 4;
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/boards/".concat(params.categoryId, "/messages.json"), {
method: "post",
body: v
});
case 4:
case 5:
res = _context.sent;
if (res.status === 0) {
(0,util/* trackEvent */.L9)(['教学课堂', '讨论', '发帖']);
message/* default.success */.ZP.success("发布成功");
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId, "/Detail/").concat(res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.id));
}
case 6:
case 7:
case "end":
return _context.stop();
}

Loading…
Cancel
Save