feat(instance): refactor modify endpoint to support config types
- Change modify endpoint from `/modify/{field}` to `/modify` with POST
- Add support for two modification types: configFile and systemConfig
- Implement config file parsing using ini package for configFile type
- Update database schema to include name in update query
- Add comprehensive input validation and error handling
- Update documentation to reflect new API changes
This commit is contained in:
10
router.go
10
router.go
@@ -47,13 +47,9 @@ func setupRoutes() {
|
||||
return
|
||||
}
|
||||
|
||||
if strings.HasPrefix(remainingPath, "modify/") {
|
||||
parts := strings.SplitN(remainingPath, "/", 2)
|
||||
if len(parts) == 2 {
|
||||
field := parts[1]
|
||||
ModifyInstanceHandler(w, r, field)
|
||||
return
|
||||
}
|
||||
if remainingPath == "modify" { // Handle `/modify` by POST request
|
||||
ModifyInstanceHandler(w, r)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user