Skip to content

Commit 956b616

Browse files
chore: fix resource endpoint
1 parent d4b8b6a commit 956b616

File tree

1 file changed

+10
-2
lines changed
  • apps/workspace-engine/pkg/server/openapi/resources

1 file changed

+10
-2
lines changed

apps/workspace-engine/pkg/server/openapi/resources/server.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,16 @@ func (r *Resources) GetVariablesForResource(c *gin.Context, workspaceId string,
181181
return
182182
}
183183

184-
resource, ok := ws.Resources().Get(resourceIdentifier)
185-
if !ok {
184+
allResources := ws.Resources().Items()
185+
var resource *oapi.Resource
186+
for _, r := range allResources {
187+
if r.Identifier == resourceIdentifier {
188+
resource = r
189+
break
190+
}
191+
}
192+
193+
if resource == nil {
186194
c.JSON(http.StatusNotFound, gin.H{
187195
"error": "Resource not found",
188196
})

0 commit comments

Comments
 (0)