update
parent
00bb55b5c3
commit
513284f589
|
@ -32,6 +32,11 @@ func (e *Event) BeforeSave(tx *gorm.DB) (err error) {
|
||||||
if e.CalendarID == "" {
|
if e.CalendarID == "" {
|
||||||
return errors.ErrorBadRequest
|
return errors.ErrorBadRequest
|
||||||
}
|
}
|
||||||
|
if e.Location == "" {
|
||||||
|
loc := ""
|
||||||
|
tx.Raw("select name from calendars where id = ?", e.CalendarID).Scan(&loc)
|
||||||
|
e.Location = loc
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue