- Add PATCH API endpoint for updating bookmarks with toggle functions - Add DELETE API endpoint for permanent bookmark deletion - Implement UpdateBookmarkUseCase with convenience methods for common actions - Implement DeleteBookmarkUseCase for permanent bookmark removal - Create BookmarkUpdateRequest domain model with builder pattern - Extend BookmarkCardView with action menu and confirmation dialog - Add context-sensitive actions based on current bookmark state - Implement optimistic updates in BookmarksViewModel - Add error handling and recovery for failed operations - Enhance UI with badges, progress indicators, and action buttons
13 lines
315 B
Swift
13 lines
315 B
Swift
import Foundation
|
|
|
|
class DeleteBookmarkUseCase {
|
|
private let repository: PBookmarksRepository
|
|
|
|
init(repository: PBookmarksRepository) {
|
|
self.repository = repository
|
|
}
|
|
|
|
func execute(bookmarkId: String) async throws {
|
|
try await repository.deleteBookmark(id: bookmarkId)
|
|
}
|
|
} |