[이민권] 게스트 계정 링크 시 삭제 기능 추가

This commit is contained in:
2023-08-24 15:39:11 +09:00
parent c43c10982c
commit 28092fcf17
2 changed files with 20 additions and 4 deletions

View File

@ -420,6 +420,17 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) {
return
}
if guestlink {
//기존 게스트 링크 삭제
guestLinkId, err := primitive.ObjectIDFromHex(oldId)
if err == nil {
_, err = sh.mongoClient.Delete(CollectionLink, bson.M{
"platform": oldType,
"_id": guestLinkId,
})
}
}
logger.Println("link success :", r.URL.Query())
}