refactor(instance): change instance deletion to use ID instead of name
- Update DBRemoveFrpcInstance to use instanceID for deletion - Modify DeleteInstanceHandler to accept and validate instanceID - Improve error messages for invalid instanceID format - Update logging to use instanceID instead of instanceName
This commit is contained in:
+2
-2
@@ -385,8 +385,8 @@ func DBQueryFrpcInstance(userID int, instanceName string) (FrpcInstance, error)
|
||||
return instance, nil
|
||||
}
|
||||
|
||||
func DBRemoveFrpcInstance(userID int, instanceName string) error {
|
||||
_, err := frpcDB.Exec("DELETE FROM frpcInstances WHERE userID = ? AND name = ?", userID, instanceName)
|
||||
func DBRemoveFrpcInstanceByID(instanceID int) error {
|
||||
_, err := frpcDB.Exec("DELETE FROM frpcInstances WHERE id = ?", instanceID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete frpc instance: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user