Explorar el Código

update example

cg33 hace 6 años
padre
commit
338679aeeb
Se han modificado 4 ficheros con 7 adiciones y 4 borrados
  1. 2 1
      tables/authors.go
  2. 2 1
      tables/external.go
  3. 2 1
      tables/posts.go
  4. 1 1
      tables/users.go

+ 2 - 1
tables/authors.go

@@ -1,13 +1,14 @@
 package tables
 
 import (
+	"github.com/GoAdminGroup/go-admin/context"
 	"github.com/GoAdminGroup/go-admin/modules/db"
 	"github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"
 	"github.com/GoAdminGroup/go-admin/template/types/form"
 )
 
 // GetAuthorsTable return the model of table author.
-func GetAuthorsTable() (authorsTable table.Table) {
+func GetAuthorsTable(ctx *context.Context) (authorsTable table.Table) {
 
 	authorsTable = table.NewDefaultTable(table.DefaultConfig())
 

+ 2 - 1
tables/external.go

@@ -1,6 +1,7 @@
 package tables
 
 import (
+	"github.com/GoAdminGroup/go-admin/context"
 	"github.com/GoAdminGroup/go-admin/modules/db"
 	"github.com/GoAdminGroup/go-admin/plugins/admin/modules/parameter"
 	"github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"
@@ -8,7 +9,7 @@ import (
 )
 
 // GetExternalTable return the model from external data source.
-func GetExternalTable() (externalTable table.Table) {
+func GetExternalTable(ctx *context.Context) (externalTable table.Table) {
 
 	externalTable = table.NewDefaultTable(table.DefaultConfig())
 

+ 2 - 1
tables/posts.go

@@ -1,6 +1,7 @@
 package tables
 
 import (
+	"github.com/GoAdminGroup/go-admin/context"
 	"github.com/GoAdminGroup/go-admin/modules/db"
 	"github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"
 	"github.com/GoAdminGroup/go-admin/template"
@@ -10,7 +11,7 @@ import (
 )
 
 // GetPostsTable return the model of table posts.
-func GetPostsTable() (postsTable table.Table) {
+func GetPostsTable(ctx *context.Context) (postsTable table.Table) {
 
 	postsTable = table.NewDefaultTable(table.DefaultConfig())
 

+ 1 - 1
tables/users.go

@@ -15,7 +15,7 @@ import (
 )
 
 // GetUserTable return the model of table user.
-func GetUserTable() (userTable table.Table) {
+func GetUserTable(ctx *context.Context) (userTable table.Table) {
 
 	userTable = table.NewDefaultTable(table.Config{
 		Driver:     db.DriverMysql,