Skip to content

Commit f442781

Browse files
authored
Merge pull request #1386 from nextcloud-libraries/fix/actions-context
fix(actions): rename content to contents
2 parents 5aa92db + 1419664 commit f442781

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ For example:
2424
+ import { defaultRemoteURL } from '@nextcloud/files/dav'
2525
```
2626

27+
#### File Actions API changes
28+
The `FileAction` API has been changed to provide a more consistent
29+
set of context to the action handlers.
30+
We're now using destructuring objects for the context parameters.
31+
For example:
32+
33+
```diff
34+
type ActionContext = {
35+
nodes: Node[],
36+
view: View,
37+
folder: Folder,
38+
contents: Node[],
39+
}
40+
41+
- action.exec(view: View, folder: Folder, dir: string): Promise<boolean>
42+
+ action.exec({ nodes, view, folder, contents }): Promise<boolean>
43+
```
44+
45+
2746
## 4.0.0-beta.1 - 2025-11-27
2847
### 🐛 Fixed bugs
2948
* fix: actions type exports by @skjnldsv in https://github.com/nextcloud-libraries/nextcloud-files/pull/1381

lib/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export type ActionContextSingle = {
1010
nodes: [Node],
1111
view: View,
1212
folder: Folder,
13-
content: Node[],
13+
contents: Node[],
1414
}
1515

1616
export type ActionContext = {
1717
nodes: Node[],
1818
view: View,
1919
folder: Folder,
20-
content: Node[],
20+
contents: Node[],
2121
}
2222

2323
export type ViewActionContext = {

0 commit comments

Comments
 (0)