[이민권] guest 계정에 link 걸면 guest link는 제거하도록 수정
This commit is contained in:
@ -422,11 +422,14 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if guestlink {
|
||||
//기존 게스트 링크 삭제
|
||||
guestLinkId, err := primitive.ObjectIDFromHex(oldId)
|
||||
if err == nil {
|
||||
_, err = sh.mongoClient.Delete(CollectionLink, bson.M{
|
||||
link, err = sh.mongoClient.FindOneAndDelete(CollectionLink, bson.M{
|
||||
"platform": oldType,
|
||||
"_id": guestLinkId,
|
||||
"uid": oldId,
|
||||
}, options.FindOneAndDelete().SetProjection(bson.M{"_id": 1}))
|
||||
|
||||
if err == nil {
|
||||
sh.mongoClient.Delete(CollectionAccount, bson.M{
|
||||
"_id": link["_id"].(primitive.ObjectID),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user