From fda83c7eb6c3a8851583ff4c8b14678f85b963f0 Mon Sep 17 00:00:00 2001 From: Punarv Pawade Date: Fri, 12 Apr 2024 13:28:54 +0530 Subject: [PATCH] client: fix db query --- api/v1/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/client/client.go b/api/v1/client/client.go index e45d297..9dc13c0 100644 --- a/api/v1/client/client.go +++ b/api/v1/client/client.go @@ -42,7 +42,7 @@ func RegisterClient(c *gin.Context) { // return // } var node *models.Node - if err := db.Model(&models.Node{}).First(&node, region_id).Error; err != nil { + if err := db.Model(&models.Node{}).Where("id = ?", region_id).First(&node).Error; err != nil { logwrapper.Errorf("failed to get node: %s", err) httpo.NewErrorResponse(http.StatusBadRequest, err.Error()).SendD(c) return