Skip to content

Commit 4700ce5

Browse files
authored
Merge pull request #1357 from naymspace/feature/improve-upload-documentation
Improve `Backpex.Fields.Upload` documentation
2 parents de11b07 + 0158903 commit 4700ce5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/backpex/fields/upload.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@ defmodule Backpex.Fields.Upload do
119119
],
120120
remove_uploads: [
121121
doc: """
122-
A function that is being called after saving an item to be able to delete removed files.
122+
A function that is being called after editing an item to be able to delete removed files.
123+
124+
Note that this function is not invoked when an item is deleted. Therefore, you must implement file deletion logic in the `c:Backpex.LiveResource.on_item_deleted/2` callback.
123125
124126
**Parameters**
125127
126128
* `:socket` - The socket.
127129
* `:item` (struct) - The item without its changes.
128-
* `removed_entries` (list) - A list of removed uploads during edit.
130+
* `removed_entries` (list) - A list of removed uploads during edit. The list only contains files that existed before the edit.
129131
130132
**Example**
131133

0 commit comments

Comments
 (0)