Re-gen admin code.
This commit is contained in:
parent
8a4dd9fb3b
commit
8219b96df7
2 changed files with 4 additions and 20 deletions
|
|
@ -96,9 +96,6 @@ func (h *Handler) PasswordTokenCreate(ctx echo.Context) error {
|
||||||
if payload.CreatedAt != nil {
|
if payload.CreatedAt != nil {
|
||||||
op.SetCreatedAt(*payload.CreatedAt)
|
op.SetCreatedAt(*payload.CreatedAt)
|
||||||
}
|
}
|
||||||
if payload.Abc != nil {
|
|
||||||
op.SetAbc(*payload.Abc)
|
|
||||||
}
|
|
||||||
_, err := op.Save(ctx.Request().Context())
|
_, err := op.Save(ctx.Request().Context())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -125,11 +122,6 @@ func (h *Handler) PasswordTokenUpdate(ctx echo.Context, id int) error {
|
||||||
} else {
|
} else {
|
||||||
op.SetCreatedAt(*payload.CreatedAt)
|
op.SetCreatedAt(*payload.CreatedAt)
|
||||||
}
|
}
|
||||||
if payload.Abc == nil {
|
|
||||||
op.ClearAbc()
|
|
||||||
} else {
|
|
||||||
op.SetAbc(*payload.Abc)
|
|
||||||
}
|
|
||||||
_, err = op.Save(ctx.Request().Context())
|
_, err = op.Save(ctx.Request().Context())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +147,6 @@ func (h *Handler) PasswordTokenList(ctx echo.Context) (*EntityList, error) {
|
||||||
Columns: []string{
|
Columns: []string{
|
||||||
"User ID",
|
"User ID",
|
||||||
"Created at",
|
"Created at",
|
||||||
"Abc",
|
|
||||||
},
|
},
|
||||||
Entities: make([]EntityValues, 0, len(res)),
|
Entities: make([]EntityValues, 0, len(res)),
|
||||||
HasNextPage: len(res) > h.Config.ItemsPerPage,
|
HasNextPage: len(res) > h.Config.ItemsPerPage,
|
||||||
|
|
@ -167,7 +158,6 @@ func (h *Handler) PasswordTokenList(ctx echo.Context) (*EntityList, error) {
|
||||||
Values: []string{
|
Values: []string{
|
||||||
fmt.Sprint(res[i].UserID),
|
fmt.Sprint(res[i].UserID),
|
||||||
res[i].CreatedAt.Format(h.Config.TimeFormat),
|
res[i].CreatedAt.Format(h.Config.TimeFormat),
|
||||||
fmt.Sprint(res[i].Abc),
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -184,7 +174,6 @@ func (h *Handler) PasswordTokenGet(ctx echo.Context, id int) (url.Values, error)
|
||||||
v := url.Values{}
|
v := url.Values{}
|
||||||
v.Set("user_id", fmt.Sprint(entity.UserID))
|
v.Set("user_id", fmt.Sprint(entity.UserID))
|
||||||
v.Set("created_at", entity.CreatedAt.Format(time.RFC3339))
|
v.Set("created_at", entity.CreatedAt.Format(time.RFC3339))
|
||||||
v.Set("abc", fmt.Sprint(entity.Abc))
|
|
||||||
return v, err
|
return v, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,12 @@
|
||||||
// Code generated by ent, DO NOT EDIT.
|
// Code generated by ent, DO NOT EDIT.
|
||||||
package admin
|
package admin
|
||||||
|
|
||||||
import (
|
import "time"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/mikestefanello/pagoda/ent/passwordtoken"
|
|
||||||
)
|
|
||||||
|
|
||||||
type PasswordToken struct {
|
type PasswordToken struct {
|
||||||
Hash *string `form:"hash"`
|
Hash *string `form:"hash"`
|
||||||
UserID int `form:"user_id"`
|
UserID int `form:"user_id"`
|
||||||
CreatedAt *time.Time `form:"created_at"`
|
CreatedAt *time.Time `form:"created_at"`
|
||||||
Abc *passwordtoken.Abc `form:"abc"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue