diff --git a/apis/record_crud.go b/apis/record_crud.go index 15015522..799b75be 100644 --- a/apis/record_crud.go +++ b/apis/record_crud.go @@ -217,6 +217,7 @@ func (api *recordApi) create(c echo.Context) error { event.HttpContext = c event.Collection = collection event.Record = record + event.UploadedFiles = form.FilesToUpload() // create the record submitErr := form.Submit(func(next forms.InterceptorNextFunc[*models.Record]) forms.InterceptorNextFunc[*models.Record] { @@ -305,6 +306,7 @@ func (api *recordApi) update(c echo.Context) error { event.HttpContext = c event.Collection = collection event.Record = record + event.UploadedFiles = form.FilesToUpload() // update the record submitErr := form.Submit(func(next forms.InterceptorNextFunc[*models.Record]) forms.InterceptorNextFunc[*models.Record] { diff --git a/core/events.go b/core/events.go index ab953402..dc100fc8 100644 --- a/core/events.go +++ b/core/events.go @@ -6,6 +6,7 @@ import ( "github.com/pocketbase/pocketbase/models/schema" "github.com/pocketbase/pocketbase/models/settings" "github.com/pocketbase/pocketbase/tools/auth" + "github.com/pocketbase/pocketbase/tools/filesystem" "github.com/pocketbase/pocketbase/tools/hook" "github.com/pocketbase/pocketbase/tools/mailer" "github.com/pocketbase/pocketbase/tools/search" @@ -160,15 +161,17 @@ type RecordViewEvent struct { type RecordCreateEvent struct { BaseCollectionEvent - HttpContext echo.Context - Record *models.Record + HttpContext echo.Context + Record *models.Record + UploadedFiles map[string][]*filesystem.File } type RecordUpdateEvent struct { BaseCollectionEvent - HttpContext echo.Context - Record *models.Record + HttpContext echo.Context + Record *models.Record + UploadedFiles map[string][]*filesystem.File } type RecordDeleteEvent struct {