From bae704501795a16e43b2678275450f64c6fa6b48 Mon Sep 17 00:00:00 2001 From: Alonza0314 Date: Fri, 8 Nov 2024 14:11:49 +0000 Subject: [PATCH] refactor: rewrite the error handle method with ueid already exists in subscriber create function --- backend/WebUI/api_webui.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/WebUI/api_webui.go b/backend/WebUI/api_webui.go index b2f00ce..519876a 100644 --- a/backend/WebUI/api_webui.go +++ b/backend/WebUI/api_webui.go @@ -1335,10 +1335,8 @@ func PostSubscriberByID(c *gin.Context) { return } if len(authSubsDataInterface) > 0 { - if authSubsDataInterface["tenantId"].(string) != claims["tenantId"].(string) { - c.JSON(http.StatusUnprocessableEntity, gin.H{}) - return - } + c.JSON(http.StatusConflict, gin.H{"cause": ueId + " already exists"}) + return } } dbOperation(ueId, servingPlmnId, "post", &subsData, claims)