[이민권] 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 {
|
if guestlink {
|
||||||
//기존 게스트 링크 삭제
|
//기존 게스트 링크 삭제
|
||||||
guestLinkId, err := primitive.ObjectIDFromHex(oldId)
|
link, err = sh.mongoClient.FindOneAndDelete(CollectionLink, bson.M{
|
||||||
|
"platform": oldType,
|
||||||
|
"uid": oldId,
|
||||||
|
}, options.FindOneAndDelete().SetProjection(bson.M{"_id": 1}))
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, err = sh.mongoClient.Delete(CollectionLink, bson.M{
|
sh.mongoClient.Delete(CollectionAccount, bson.M{
|
||||||
"platform": oldType,
|
"_id": link["_id"].(primitive.ObjectID),
|
||||||
"_id": guestLinkId,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user