File tree Expand file tree Collapse file tree
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Repositories Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88import Foundation
99import Dependencies
10+ import os
1011
1112struct DefaultQRCodeScanRepository : QRCodeScanRepository {
1213 private let strategies : [ QRCodeParsingStrategy ] = [
@@ -19,14 +20,23 @@ struct DefaultQRCodeScanRepository: QRCodeScanRepository {
1920
2021 @Dependency ( \. networkProvider) private var networkProvider
2122
22- func parse( _ url: URL ) async throws ( QRParseError) -> ParsedQRResult {
23+ func parse( _ url: URL , user : User ) async throws ( QRParseError) -> ParsedQRResult {
2324 guard let host = url. host ( ) else { throw . invalidURL }
2425
2526 for strategy in strategies {
2627 guard strategy. canHandle ( host: host) else { continue }
2728 return try await strategy. parse ( url, networkProvider: networkProvider)
2829 }
2930
31+ Task . detached ( priority: . background) {
32+ do {
33+ let endpoint = QRCodeScannerEndpoint . notifyUnsupportedBrand ( url: url, user: user)
34+ try await networkProvider. requestVoid ( endpoint: endpoint)
35+ } catch {
36+ Logger . network. error ( " 미지원 브랜드 디스코드 웹훅 발송 실패: \( error) " )
37+ }
38+ }
39+
3040 throw . unsupportedBrand
3141 }
3242}
You can’t perform that action at this time.
0 commit comments