fix: remove dead DeleteEnvVarsByAppID and add empty-key 400 test
All checks were successful
Check / check (pull_request) Successful in 3m11s

- Remove DeleteEnvVarsByAppID() which became dead code after
  ReplaceEnvVarsByAppID() was introduced (handles deletion internally
  within its transaction).
- Add TestHandleEnvVarSaveEmptyKeyRejected to verify that POSTing a
  JSON array with an empty key returns 400 Bad Request.

Addresses review advisories on PR #158.
This commit is contained in:
user
2026-03-10 17:42:50 -07:00
parent 5a986aa8fd
commit 609ce1d0d3
2 changed files with 26 additions and 11 deletions

View File

@@ -128,17 +128,6 @@ func FindEnvVarsByAppID(
return envVars, rows.Err()
}
// DeleteEnvVarsByAppID deletes all env vars for an app.
func DeleteEnvVarsByAppID(
ctx context.Context,
db *database.Database,
appID string,
) error {
_, err := db.Exec(ctx, "DELETE FROM app_env_vars WHERE app_id = ?", appID)
return err
}
// EnvVarPair is a key-value pair for bulk env var operations.
type EnvVarPair struct {
Key string