From d2e06961b9fc9c80e6323065be4edd2c0b7f4399 Mon Sep 17 00:00:00 2001 From: mklee Date: Thu, 24 Aug 2023 16:45:01 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=AF=BC=EA=B6=8C]=20guest=20?= =?UTF-8?q?=EA=B3=84=EC=A0=95=EC=97=90=20link=20=EA=B1=B8=EB=A9=B4=20guest?= =?UTF-8?q?=20link=EB=8A=94=20=EC=A0=9C=EA=B1=B0=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/service.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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), }) } }