mirror of
https://github.com/fastenhealth/fasten-onprem.git
synced 2026-02-19 00:29:10 -06:00
* 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.
16 lines
416 B
Go
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()
|
|
}
|
|
}
|