diff --git a/core/service.go b/core/service.go index 453a8c9..082062d 100644 --- a/core/service.go +++ b/core/service.go @@ -422,11 +422,14 @@ func (sh *serviceDescription) link(w http.ResponseWriter, r *http.Request) { 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 { - _, err = sh.mongoClient.Delete(CollectionLink, bson.M{ - "platform": oldType, - "_id": guestLinkId, + sh.mongoClient.Delete(CollectionAccount, bson.M{ + "_id": link["_id"].(primitive.ObjectID), }) } }