- Add BookmarkLabel model and DTO - Create LabelsRepository and PLabelsRepository protocol - Add GetLabelsUseCase for fetching labels - Update BookmarkMapper to handle labels - Add LabelsView and LabelsViewModel for UI - Update BookmarksView and BookmarkLabelsView to display labels - Add green2 color asset for labels - Update API and repository layers to support labels
15 lines
308 B
Swift
15 lines
308 B
Swift
import Foundation
|
|
|
|
class LabelsRepository: PLabelsRepository {
|
|
private let api: PAPI
|
|
|
|
init(api: PAPI) {
|
|
self.api = api
|
|
}
|
|
|
|
func getLabels() async throws -> [BookmarkLabel] {
|
|
let dtos = try await api.getBookmarkLabels()
|
|
return dtos.map { $0.toDomain() }
|
|
}
|
|
}
|