changed how servers group work

This commit is contained in:
ACoolName 2024-05-25 01:49:44 +03:00
parent d565b05ab7
commit b799ce4424

View File

@ -803,8 +803,8 @@ func LoadGroup(group *gin.RouterGroup, mongo_client *mongo.Client, config models
authConnection := auth.Connection{DatabaseConnection: mongo_client}
group.POST("/:server_id/start", auth.AuthorizedTo(models.Start, authConnection.ServerAuthorized(models.Start)), connection.StartServer)
group.POST("/", auth.AuthorizedTo(models.Create), connection.CreateServer)
group.GET("/", auth.AuthorizedTo(0), connection.GetServers)
group.POST("", auth.AuthorizedTo(models.Create), connection.CreateServer)
group.GET("", auth.AuthorizedTo(0), connection.GetServers)
group.POST("/:server_id/stop", auth.AuthorizedTo(models.Stop, authConnection.ServerAuthorized(models.Stop)), connection.StopServer)
group.DELETE("/:server_id", auth.AuthorizedTo(models.Delete, authConnection.ServerAuthorized(models.Delete)), connection.DeleteServer)
group.POST("/:server_id/run_command", auth.AuthorizedTo(models.RunCommand, authConnection.ServerAuthorized(models.RunCommand)), connection.RunCommand)