Skip to content

Commit b557883

Browse files
committed
refactor: id 타입에 옵셔널 제거
1 parent b7bc425 commit b557883

5 files changed

Lines changed: 3 additions & 9 deletions

File tree

DevLog/Data/DTO/PushNotificationResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
struct PushNotificationResponse {
11-
let id: String?
11+
let id: String
1212
let title: String
1313
let body: String
1414
let receivedAt: Date

DevLog/Data/DTO/TodoDTO.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct TodoRequest: Dictionaryable {
2323
}
2424

2525
struct TodoResponse {
26-
let id: String?
26+
let id: String
2727
let isPinned: Bool
2828
let isCompleted: Bool
2929
let isChecked: Bool

DevLog/Data/DTO/WebPageDTO.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct WebPageRequest: Encodable {
1515
}
1616

1717
struct WebPageResponse {
18-
let id: String?
18+
let id: String
1919
let title: String
2020
let url: String
2121
let displayURL: String

DevLog/Data/Mapper/PushNotificationMapping.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
extension PushNotificationResponse {
99
func toDomain() throws -> PushNotification {
10-
guard let id = self.id else {
11-
throw DataError.invalidData("PushNotificationResponse.id is nil")
12-
}
1310
guard let todoKind = TodoKind(rawValue: self.todoKind) else {
1411
throw DataError.invalidData("PushNotificationResponse.todoKind is invalid: \(self.todoKind)")
1512
}

DevLog/Data/Mapper/TodoMapping.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ extension TodoRequest {
2525

2626
extension TodoResponse {
2727
func toDomain() throws -> Todo {
28-
guard let id = self.id else {
29-
throw DataError.invalidData("TodoResponse.id is nil")
30-
}
3128
guard let kind = TodoKind(rawValue: self.kind) else {
3229
throw DataError.invalidData("TodoResponse.kind is invalid: \(self.kind)")
3330
}

0 commit comments

Comments
 (0)