Skip to content

Commit 3aad83d

Browse files
committed
feat: Change CombinedLibrary model in library.go
1 parent e4f1eda commit 3aad83d

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

pkg/db/library.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,11 @@ package db
22

33
import (
44
"github.com/Mangatsu/server/internal/config"
5-
"github.com/Mangatsu/server/pkg/types/model"
5+
"github.com/Mangatsu/server/pkg/model"
66
"github.com/doug-martin/goqu/v9"
77
log "github.com/sirupsen/logrus"
88
)
99

10-
// FIXME: it won't work yet!! CombinedLibrary has to be a plain struct,
11-
// something like this:
12-
//
13-
// type User struct {
14-
// FirstName string `db:"first_name"`
15-
// LastName string `db:"last_name"`
16-
// }
17-
18-
type CombinedLibrary struct {
19-
model.Library
20-
Galleries []model.Gallery
21-
}
22-
2310
func StorePaths(givenLibraries []config.Library) error {
2411
for _, library := range givenLibraries {
2512
libraries, err := getLibrary(library.ID, "")
@@ -54,8 +41,8 @@ func GetOnlyLibraries() ([]model.Library, error) {
5441
return libraries, err
5542
}
5643

57-
func GetLibraries() ([]CombinedLibrary, error) {
58-
var libraries []CombinedLibrary
44+
func GetLibraries() ([]model.CombinedLibrary, error) {
45+
var libraries []model.CombinedLibrary
5946
err := database.QB().
6047
From("library").
6148
LeftJoin(

0 commit comments

Comments
 (0)