Re-gen admin code.

This commit is contained in:
mikestefanello 2025-04-15 07:37:55 -04:00
parent 8a4dd9fb3b
commit 8219b96df7
2 changed files with 4 additions and 20 deletions

View file

@ -96,9 +96,6 @@ func (h *Handler) PasswordTokenCreate(ctx echo.Context) error {
if payload.CreatedAt != nil {
op.SetCreatedAt(*payload.CreatedAt)
}
if payload.Abc != nil {
op.SetAbc(*payload.Abc)
}
_, err := op.Save(ctx.Request().Context())
return err
}
@ -125,11 +122,6 @@ func (h *Handler) PasswordTokenUpdate(ctx echo.Context, id int) error {
} else {
op.SetCreatedAt(*payload.CreatedAt)
}
if payload.Abc == nil {
op.ClearAbc()
} else {
op.SetAbc(*payload.Abc)
}
_, err = op.Save(ctx.Request().Context())
return err
}
@ -155,7 +147,6 @@ func (h *Handler) PasswordTokenList(ctx echo.Context) (*EntityList, error) {
Columns: []string{
"User ID",
"Created at",
"Abc",
},
Entities: make([]EntityValues, 0, len(res)),
HasNextPage: len(res) > h.Config.ItemsPerPage,
@ -167,7 +158,6 @@ func (h *Handler) PasswordTokenList(ctx echo.Context) (*EntityList, error) {
Values: []string{
fmt.Sprint(res[i].UserID),
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.Set("user_id", fmt.Sprint(entity.UserID))
v.Set("created_at", entity.CreatedAt.Format(time.RFC3339))
v.Set("abc", fmt.Sprint(entity.Abc))
return v, err
}

View file

@ -1,17 +1,12 @@
// Code generated by ent, DO NOT EDIT.
package admin
import (
"time"
"github.com/mikestefanello/pagoda/ent/passwordtoken"
)
import "time"
type PasswordToken struct {
Hash *string `form:"hash"`
UserID int `form:"user_id"`
CreatedAt *time.Time `form:"created_at"`
Abc *passwordtoken.Abc `form:"abc"`
}
type User struct {