|
|
@ -81,10 +81,10 @@ export const collectionUpload = createAction(
|
|
|
|
|
|
|
|
|
|
|
|
export const setCacheItem = createAction(
|
|
|
|
export const setCacheItem = createAction(
|
|
|
|
"SET_CACHE_ITEM",
|
|
|
|
"SET_CACHE_ITEM",
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.CollectionItemManager, item: Etebase.CollectionItem) => {
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
return await itemMgr.cacheSave(item);
|
|
|
|
return await itemMgr.cacheSave(item);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.CollectionItemManager, item: Etebase.CollectionItem) => {
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
colUid: col.uid,
|
|
|
|
colUid: col.uid,
|
|
|
|
itemUid: item.uid,
|
|
|
|
itemUid: item.uid,
|
|
|
@ -95,10 +95,10 @@ export const setCacheItem = createAction(
|
|
|
|
|
|
|
|
|
|
|
|
export const unsetCacheItem = createAction(
|
|
|
|
export const unsetCacheItem = createAction(
|
|
|
|
"UNSET_CACHE_ITEM",
|
|
|
|
"UNSET_CACHE_ITEM",
|
|
|
|
(_colUid: string, _itemMgr: Etebase.CollectionItemManager, itemUid: string) => {
|
|
|
|
(_colUid: string, _itemMgr: Etebase.ItemManager, itemUid: string) => {
|
|
|
|
return itemUid;
|
|
|
|
return itemUid;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(colUid: string, _itemMgr: Etebase.CollectionItemManager, itemUid: string) => {
|
|
|
|
(colUid: string, _itemMgr: Etebase.ItemManager, itemUid: string) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
colUid,
|
|
|
|
colUid,
|
|
|
|
itemUid,
|
|
|
|
itemUid,
|
|
|
@ -109,14 +109,14 @@ export const unsetCacheItem = createAction(
|
|
|
|
|
|
|
|
|
|
|
|
export const setCacheItemMulti = createAction(
|
|
|
|
export const setCacheItemMulti = createAction(
|
|
|
|
"SET_CACHE_ITEM_MULTI",
|
|
|
|
"SET_CACHE_ITEM_MULTI",
|
|
|
|
async (_colUid: string, itemMgr: Etebase.CollectionItemManager, items: Etebase.CollectionItem[]) => {
|
|
|
|
async (_colUid: string, itemMgr: Etebase.ItemManager, items: Etebase.Item[]) => {
|
|
|
|
const ret = [];
|
|
|
|
const ret = [];
|
|
|
|
for (const item of items) {
|
|
|
|
for (const item of items) {
|
|
|
|
ret.push(await itemMgr.cacheSave(item));
|
|
|
|
ret.push(await itemMgr.cacheSave(item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(colUid: string, _itemMgr: Etebase.CollectionItemManager, items: Etebase.CollectionItem[], _deps?: Etebase.CollectionItem[]) => {
|
|
|
|
(colUid: string, _itemMgr: Etebase.ItemManager, items: Etebase.Item[], _deps?: Etebase.Item[]) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
colUid,
|
|
|
|
colUid,
|
|
|
|
items: items,
|
|
|
|
items: items,
|
|
|
@ -126,7 +126,7 @@ export const setCacheItemMulti = createAction(
|
|
|
|
|
|
|
|
|
|
|
|
export const itemBatch = createAction(
|
|
|
|
export const itemBatch = createAction(
|
|
|
|
"ITEM_BATCH",
|
|
|
|
"ITEM_BATCH",
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.CollectionItemManager, items: Etebase.CollectionItem[], deps?: Etebase.CollectionItem[]) => {
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.ItemManager, items: Etebase.Item[], deps?: Etebase.Item[]) => {
|
|
|
|
await itemMgr.batch(items, deps);
|
|
|
|
await itemMgr.batch(items, deps);
|
|
|
|
const ret = [];
|
|
|
|
const ret = [];
|
|
|
|
for (const item of items) {
|
|
|
|
for (const item of items) {
|
|
|
@ -134,7 +134,7 @@ export const itemBatch = createAction(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.CollectionItemManager, items: Etebase.CollectionItem[], _deps?: Etebase.CollectionItem[]) => {
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.ItemManager, items: Etebase.Item[], _deps?: Etebase.Item[]) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
colUid: col.uid,
|
|
|
|
colUid: col.uid,
|
|
|
|
items: items,
|
|
|
|
items: items,
|
|
|
|