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