- Add CREATE API endpoint for new bookmarks with POST request - Implement CreateBookmarkRequestDto and CreateBookmarkResponseDto - Create AddBookmarkView with form validation and clipboard integration - Add AddBookmarkViewModel with URL validation and label parsing - Implement CreateBookmarkUseCase with convenience methods - Extend BookmarksRepository with createBookmark method returning server message - Add comprehensive error handling for bookmark creation scenarios - Integrate WebView dark mode support with CSS variables and system color scheme - Add dynamic theme switching based on iOS appearance settings - Enhance WebView styling with iOS-native colors and typography - Fix BookmarksView refresh after bookmark creation - Add floating action button and sheet presentation for adding bookmarks - Implement form validation with real-time feedback - Add clipboard URL detection and paste functionality
28 lines
795 B
Swift
28 lines
795 B
Swift
import Foundation
|
|
|
|
struct CreateBookmarkRequest {
|
|
let url: String
|
|
let title: String?
|
|
let labels: [String]?
|
|
|
|
init(url: String, title: String? = nil, labels: [String]? = nil) {
|
|
self.url = url
|
|
self.title = title
|
|
self.labels = labels
|
|
}
|
|
}
|
|
|
|
// Convenience Initializers
|
|
extension CreateBookmarkRequest {
|
|
static func fromURL(_ url: String) -> CreateBookmarkRequest {
|
|
return CreateBookmarkRequest(url: url)
|
|
}
|
|
|
|
static func fromURLWithTitle(_ url: String, title: String) -> CreateBookmarkRequest {
|
|
return CreateBookmarkRequest(url: url, title: title)
|
|
}
|
|
|
|
static func fromURLWithLabels(_ url: String, labels: [String]) -> CreateBookmarkRequest {
|
|
return CreateBookmarkRequest(url: url, labels: labels)
|
|
}
|
|
} |