增加店铺题库类型选择的保存

This commit is contained in:
zhl 2021-04-25 14:37:14 +08:00
parent f694af9603
commit 2c323c9688
2 changed files with 19 additions and 1 deletions

View File

@ -119,4 +119,19 @@ class ShopController extends BaseController {
versionid: shop.gameInfo.versionid
}
}
@permission('shop:edit')
@router('post /shop/save_qtype')
async updateQTypes(req, res) {
let { shopid, qtypes } = req.params
if (!shopid) {
throw new ZError(11, 'params mismatch')
}
let shop = await Shop.findById(shopid)
if (!shop) {
throw new ZError(12, 'shop not found')
}
shop.qtypes = qtypes
await shop.save()
return {}
}
}

View File

@ -102,7 +102,10 @@ class ShopClass extends BaseModule {
*/
@prop()
public gameInfo?: GameInfo
/**
*
* @type {string[]}
*/
@prop()
public qtypes: string[]