feat: SEO change history
This commit is contained in:
@@ -24,16 +24,13 @@ type Service struct {
|
||||
app *backpack.App
|
||||
}
|
||||
|
||||
// NewService returns the service of a booted application. It needs the
|
||||
// application's database; the signpost registry is optional (without it no
|
||||
// content type takes part).
|
||||
// NewService returns the service of a booted application. The database
|
||||
// and the signpost registry are looked up when used, so a binary that runs
|
||||
// a console command without a database still boots.
|
||||
func NewService(app *backpack.App) (*Service, error) {
|
||||
if app == nil {
|
||||
return nil, ErrNotBooted
|
||||
}
|
||||
if db, ok := app.Lookup[*gorm.DB](); !ok || db == nil {
|
||||
return nil, errors.New("database is not configured")
|
||||
}
|
||||
return &Service{app: app}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user