提交 4730258f 编写于 作者: L ljw

完善接口

上级 48f59522
...@@ -40,12 +40,16 @@ exports.main = async (event, context) => { ...@@ -40,12 +40,16 @@ exports.main = async (event, context) => {
if (tmp.affectedDocs == 1) { if (tmp.affectedDocs == 1) {
const collection1 = db.collection('mustgo-team') const collection1 = db.collection('mustgo-team')
const res1 = await collection1.doc(teamid).remove() const res1 = await collection1.doc(teamid).remove()
const tmp2 = await activitycollection.where({
team_id:teamid
}).remove()
} }
const res = await collection.doc(event.userId).update({ const res = await collection.doc(event.userId).update({
team_id: "" team_id: ""
}) })
if (res.updated === 1) { if (res.updated === 1 && res1.affectedDocs != 1) {
const activity = db.collection('mustgo-team-activity') const activity = db.collection('mustgo-team-activity')
let res2 = await activity.where({ let res2 = await activity.where({
...@@ -64,6 +68,12 @@ exports.main = async (event, context) => { ...@@ -64,6 +68,12 @@ exports.main = async (event, context) => {
}).remove() }).remove()
} }
return {
"code": 200,
"message": "退出小队成功",
"data": {}
}
} else {
return { return {
"code": 200, "code": 200,
"message": "退出小队成功", "message": "退出小队成功",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册