|
@@ -24,8 +24,8 @@ router.use(function timeLog(req, res, next) {
|
|
|
});
|
|
|
|
|
|
async function getTypeInfo({ userInfo, book_id, type }) {
|
|
|
- if(!type) {
|
|
|
- return ''
|
|
|
+ if (!type) {
|
|
|
+ return "";
|
|
|
}
|
|
|
// type 是否存在重复项,有就返回id,没有就新增 再返回id
|
|
|
const isAddType = await isType({
|
|
@@ -64,10 +64,10 @@ router.post("/", async function (req, res) {
|
|
|
files = [],
|
|
|
userInfo = {},
|
|
|
} = req.body;
|
|
|
-
|
|
|
+ const type_id = await getTypeInfo({ userInfo, book_id, type });
|
|
|
const insertId = await record_insert({
|
|
|
book_id,
|
|
|
- type_id: getTypeInfo({ userInfo, book_id, type }),
|
|
|
+ type_id: type_id,
|
|
|
author_id: userInfo.user_id,
|
|
|
total_fee,
|
|
|
remark,
|