fix: map unknown role/environment to 422, set environment in one UPDATE
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful

This commit is contained in:
2026-10-23 21:39:41 +11:00
parent 8c1bfda4c5
commit 033a5b0a61
7 changed files with 131 additions and 11 deletions
+9
View File
@@ -90,6 +90,15 @@ func (m *memStore) GetNode(_ context.Context, c string) (*models.Node, error) {
}
return &n, nil
}
func (m *memStore) SetNodeEnvironment(_ context.Context, c, env string) (*models.Node, error) {
n, ok := m.nodes[c]
if !ok {
return nil, database.ErrNotFound
}
n.Environment = env
m.nodes[c] = n
return &n, nil
}
func (m *memStore) ListNodes(context.Context) ([]models.Node, error) {
out := []models.Node{}
for _, n := range m.nodes {