mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 18:16:26 +00:00
Fix swagger doc and rename references for time db fields
This commit is contained in:
@ -21,67 +21,3 @@ func GetByUserIDType(userID uint, authType string) (Model, error) {
|
||||
First(&auth)
|
||||
return auth, result.Error
|
||||
}
|
||||
|
||||
/*
|
||||
// Create will create a Auth from this model
|
||||
func Create(auth *Model) (int, error) {
|
||||
if auth.ID != 0 {
|
||||
return 0, eris.New("Cannot create auth when model already has an ID")
|
||||
}
|
||||
|
||||
auth.Touch(true)
|
||||
|
||||
db := database.GetInstance()
|
||||
// nolint: gosec
|
||||
result, err := db.NamedExec(`INSERT INTO `+fmt.Sprintf("`%s`", tableName)+` (
|
||||
created_on,
|
||||
modified_on,
|
||||
user_id,
|
||||
type,
|
||||
secret,
|
||||
is_deleted
|
||||
) VALUES (
|
||||
:created_on,
|
||||
:modified_on,
|
||||
:user_id,
|
||||
:type,
|
||||
:secret,
|
||||
:is_deleted
|
||||
)`, auth)
|
||||
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
last, lastErr := result.LastInsertId()
|
||||
if lastErr != nil {
|
||||
return 0, lastErr
|
||||
}
|
||||
|
||||
return int(last), nil
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Update will Update a Auth from this model
|
||||
func Update(auth *Model) error {
|
||||
if auth.ID == 0 {
|
||||
return eris.New("Cannot update auth when model doesn't have an ID")
|
||||
}
|
||||
|
||||
auth.Touch(false)
|
||||
|
||||
db := database.GetInstance()
|
||||
// nolint: gosec
|
||||
_, err := db.NamedExec(`UPDATE `+fmt.Sprintf("`%s`", tableName)+` SET
|
||||
created_on = :created_on,
|
||||
modified_on = :modified_on,
|
||||
user_id = :user_id,
|
||||
type = :type,
|
||||
secret = :secret,
|
||||
is_deleted = :is_deleted
|
||||
WHERE id = :id`, auth)
|
||||
|
||||
return err
|
||||
}
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@ func List(pageInfo model.PageInfo, filters []model.Filter) (entity.ListResponse,
|
||||
var result entity.ListResponse
|
||||
|
||||
defaultSort := model.Sort{
|
||||
Field: "created_on",
|
||||
Field: "created_at",
|
||||
Direction: "ASC",
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user