File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,13 @@ export function getAssets() {
10
10
dispatch ( startLoader ( ) ) ;
11
11
try {
12
12
const response = await apiClient . get ( '/S3/objects' ) ;
13
- dispatch ( setAssets ( response . data . assets , response . data . totalSize ) ) ;
13
+
14
+ const assetData = {
15
+ assets : response . data . assets ,
16
+ totalSize : response . data . totalSize
17
+ } ;
18
+
19
+ dispatch ( setAssets ( assetData ) ) ;
14
20
dispatch ( stopLoader ( ) ) ;
15
21
} catch ( error ) {
16
22
dispatch ( {
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ const assetsSlice = createSlice({
9
9
name : 'assets' ,
10
10
initialState,
11
11
reducers : {
12
- setAssets : ( state , action ) => action . payload ,
12
+ setAssets : ( state , action ) => {
13
+ state . list = action . payload . assets ;
14
+ state . totalSize = action . payload . totalSize ;
15
+ } ,
13
16
deleteAsset : ( state , action ) => {
14
17
const key = action . payload ;
15
18
const index = state . list . findIndex ( ( asset ) => asset . key === key ) ;
You can’t perform that action at this time.
0 commit comments