diff --git a/Application/Infra/Sources/Service/FunctionAPIEndpoint.swift b/Application/Infra/Sources/Service/FunctionAPIEndpoint.swift index 2c3fda1c..7c141eb6 100644 --- a/Application/Infra/Sources/Service/FunctionAPIEndpoint.swift +++ b/Application/Infra/Sources/Service/FunctionAPIEndpoint.swift @@ -16,12 +16,14 @@ extension FunctionAPIEndpoint where Response == EmptyAPIResponse { Self(method: .delete, path: "/todos/\(functionAPIPathSegment(id))/deletion-request") } + // WebPage id는 이미 Firestore document id로 percent-encoded된 값 + // 여기서 다시 인코딩하면 Functions가 실제 문서 id와 다른 값을 받는다 static func requestWebPageDeletion(_ id: String) -> Self { - Self(method: .post, path: "/web-pages/\(functionAPIPathSegment(id))/deletion-request") + Self(method: .post, path: "/web-pages/\(id)/deletion-request") } static func undoWebPageDeletion(_ id: String) -> Self { - Self(method: .delete, path: "/web-pages/\(functionAPIPathSegment(id))/deletion-request") + Self(method: .delete, path: "/web-pages/\(id)/deletion-request") } static func requestPushNotificationDeletion(_ id: String) -> Self { diff --git a/Application/Infra/Tests/Service/FunctionAPIEndpointTests.swift b/Application/Infra/Tests/Service/FunctionAPIEndpointTests.swift new file mode 100644 index 00000000..ff8be08c --- /dev/null +++ b/Application/Infra/Tests/Service/FunctionAPIEndpointTests.swift @@ -0,0 +1,27 @@ +// +// FunctionAPIEndpointTests.swift +// InfraTests +// +// Created by opfic on 7/3/26. +// + +import Testing +@testable import Infra + +struct FunctionAPIEndpointTests { + @Test("WebPage 삭제 endpoint는 Firestore document id를 재인코딩하지 않는다") + func WebPage_삭제_endpoint는_Firestore_document_id를_재인코딩하지_않는다() { + let id = "https%3A%2F%2Fgithub%2Ecom%2Fopficdev" + let endpoint = FunctionAPIEndpoint.requestWebPageDeletion(id) + + #expect(endpoint.path == "/web-pages/\(id)/deletion-request") + } + + @Test("WebPage 삭제 복구 endpoint는 Firestore document id를 재인코딩하지 않는다") + func WebPage_삭제_복구_endpoint는_Firestore_document_id를_재인코딩하지_않는다() { + let id = "https%3A%2F%2Fgithub%2Ecom%2Fopficdev" + let endpoint = FunctionAPIEndpoint.undoWebPageDeletion(id) + + #expect(endpoint.path == "/web-pages/\(id)/deletion-request") + } +} diff --git a/Application/Shared/Version.xcconfig b/Application/Shared/Version.xcconfig index 37b94782..5a114760 100644 --- a/Application/Shared/Version.xcconfig +++ b/Application/Shared/Version.xcconfig @@ -1,2 +1,2 @@ -MARKETING_VERSION = 1.3 +MARKETING_VERSION = 1.4 IPHONEOS_DEPLOYMENT_TARGET = 17.0