Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Application/Infra/Sources/Service/FunctionAPIEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
27 changes: 27 additions & 0 deletions Application/Infra/Tests/Service/FunctionAPIEndpointTests.swift
Original file line number Diff line number Diff line change
@@ -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<EmptyAPIResponse>.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<EmptyAPIResponse>.undoWebPageDeletion(id)

#expect(endpoint.path == "/web-pages/\(id)/deletion-request")
}
}
2 changes: 1 addition & 1 deletion Application/Shared/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MARKETING_VERSION = 1.3
MARKETING_VERSION = 1.4
IPHONEOS_DEPLOYMENT_TARGET = 17.0
Loading