initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package db
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// GetConfig fetches the application config from the database
|
||||
func GetConfig(db *gorm.DB) (*AppConfig, error) {
|
||||
var cfg AppConfig
|
||||
err := db.First(&cfg, 1).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &cfg, nil
|
||||
}
|
||||
Reference in New Issue
Block a user