Files
Jason Kulatunga c85e829c46 Adding new system settings table. (#409)
* Adding new system settings table.
Adding associated database migration.
Added tests
Fixing tests for user-settings.

* updated migration, make sure default system settings are created.
Added database commands to create and update system settings.
Added generic response wrapper.

* make sure we can get related versions (fasten sources, onprem and desktop) when starting the app.
2024-02-09 09:10:06 -08:00

16 lines
416 B
Go

package middleware
import (
"github.com/fastenhealth/fasten-onprem/backend/pkg"
"github.com/fastenhealth/fasten-onprem/backend/pkg/database"
"github.com/gin-gonic/gin"
)
func RepositoryMiddleware(deviceRepo database.DatabaseRepository) gin.HandlerFunc {
//TODO: determine where we can call defer deviceRepo.Close()
return func(c *gin.Context) {
c.Set(pkg.ContextKeyTypeDatabase, deviceRepo)
c.Next()
}
}