Manage display of book covers
This commit is contained in:
@@ -18,6 +18,10 @@ type HttpError struct {
|
||||
}
|
||||
|
||||
func ValidateId(db *gorm.DB, id uint, value any) error {
|
||||
//id = 0 means empty id, so no check
|
||||
if id == 0 {
|
||||
return nil
|
||||
}
|
||||
record := map[string]any{}
|
||||
result := db.Model(value).First(&record, id)
|
||||
if result.Error == nil {
|
||||
|
||||
Reference in New Issue
Block a user