Skip to content

Commit fce6db9

Browse files
committed
check that record is found
1 parent c07acfa commit fce6db9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/api/resource.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,12 +1560,11 @@ func (h APIHandler) manualTokenPatch(c *gin.Context) {
15601560
JOIN
15611561
clusters
15621562
ON clusters.id = tfo_resources.cluster_id
1563-
WHERE
1564-
clusters.name = ?
1563+
WHERE clusters.name = ?
15651564
AND tfo_resources.namespace = ?
15661565
AND tfo_resources.name = ?
15671566
AND tfo_resource_specs.generation = tfo_resources.current_generation
1568-
`, resourceName, namespace, clusterName).Scan(&tfoResourceSpec)
1567+
`, clusterName, namespace, resourceName).Scan(&tfoResourceSpec)
15691568
if result.Error != nil {
15701569
c.JSON(http.StatusUnprocessableEntity, response(http.StatusUnprocessableEntity, fmt.Sprintf("error getting TFOResourceSpec: %v", result.Error), nil))
15711570
return

0 commit comments

Comments
 (0)