feat(resources): add cursor, group by on /api/favorites/resources
This commit is contained in:
@@ -508,12 +508,8 @@ const batchToolbar = {
|
||||
const data = await response.json();
|
||||
const inserted = data.stats?.inserted || 0;
|
||||
|
||||
// Replace cache directly from response (no extra GET)
|
||||
if (data.favorites && favorites._replaceCacheFromResponse) {
|
||||
favorites._replaceCacheFromResponse(data.favorites);
|
||||
} else {
|
||||
await favorites._fetchFromServer();
|
||||
}
|
||||
// Re-fetch the isFavorite cache from the server.
|
||||
await favorites._fetchFromServer();
|
||||
|
||||
this.clear();
|
||||
loadFiles();
|
||||
|
||||
@@ -122,7 +122,7 @@ const contextMenus = {
|
||||
// Check if folder is already in favorites to toggle
|
||||
if (favorites?.isFavorite(folder.id, 'folder')) {
|
||||
// Remove from favorites
|
||||
const ok = await favorites.removeFromFavorites(folder.id, 'folder');
|
||||
const ok = await favorites.removeFromFavorites(folder.id, 'folder', folder.name);
|
||||
if (ok && ui && typeof ui.setFavoriteVisualState === 'function') {
|
||||
ui.setFavoriteVisualState(folder.id, 'folder', false);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ const contextMenus = {
|
||||
// Check if file is already in favorites to toggle
|
||||
if (favorites?.isFavorite(file.id, 'file')) {
|
||||
// Remove from favorites
|
||||
const ok = await favorites.removeFromFavorites(file.id, 'file');
|
||||
const ok = await favorites.removeFromFavorites(file.id, 'file', file.name);
|
||||
if (ok && ui && typeof ui.setFavoriteVisualState === 'function') {
|
||||
ui.setFavoriteVisualState(file.id, 'file', false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user