Skip to content

Commit

Permalink
[pocketbase#1194] refactored forms.RecordUpsert to allow easier file …
Browse files Browse the repository at this point in the history
…upload
  • Loading branch information
ganigeorgiev committed Dec 10, 2022
1 parent 972b06c commit 707f35f
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 128 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## (WIP) v0.10.0

- Removed `rest.UploadedFile` struct (see below `filesystem.File`).

- Added generic file resource struct that allows loading and uploading file content from
different sources (at the moment multipart/formdata requests and from the local filesystem).
```
filesystem.File{}
filesystem.NewFileFromPath(path)
filesystem.NewFileFromMultipart(multipartHeader)
filesystem/System.UploadFile(file)
```

- Refactored `forms.RecordUpsert` to allow more easily loading and removing files programmatically.
```
forms.RecordUpsert.LoadFiles(key, filesystem.File...) // add new filesystem.File to the form for upload
forms.RecordUpsert.RemoveFiles(key, filenames...) // marks the filenames for deletion
```

- Optimized memory allocations (~20% improvement).


## v0.9.2

- Fixed field column name conflict on record deletion ([#1220](https://github.com/pocketbase/pocketbase/discussions/1220)).
Expand Down
Loading

0 comments on commit 707f35f

Please sign in to comment.