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
81 changes: 0 additions & 81 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ let package = Package(
name: "Package",
dependencies: [
.package(url: "https://github.com/Moya/Moya.git", from: "15.0.0"),
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.5.0"),
.package(url: "https://github.com/google/GoogleSignIn-iOS.git", from: "8.0.0")
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public extension TargetDependency {

public extension TargetDependency.SPM {
static let Moya = TargetDependency.external(name: "Moya")
static let Firebase = TargetDependency.external(name: "FirebaseAuth")
static let GoogleSignIn = TargetDependency.external(name: "GoogleSignIn")
}

Expand Down
1 change: 0 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ let targets: [Target] = [
scripts: scripts,
dependencies: [
.SPM.Moya,
.SPM.Firebase,
.SPM.GoogleSignIn,
.domain(target: .Domain)
],
Expand Down
11 changes: 0 additions & 11 deletions Projects/App/Sources/Application/GPleApp.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import SwiftUI
import FirebaseCore
import Firebase


class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}

@main
struct GoogleSignInProjectApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
@StateObject var viewModel: LoginViewModel = LoginViewModel()
@StateObject var userInfoViewModel: UserInfoViewModel = UserInfoViewModel()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public final class PostViewModel: ObservableObject {
}

public func myInfo(completion: @escaping (Bool) -> Void) {
userProvider.request(.userInfoInput(authorization: accessToken)) { result in
userProvider.request(.myInfo(authorization: accessToken)) { result in
switch result {
case let .success(response):
do {
Expand Down
9 changes: 7 additions & 2 deletions Projects/Domain/Sources/API/User/UserAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Moya

public enum UserAPI {
case userInfoInput(authorization: String, name: String, number: String, file: Data?)
case myInfo(authorization: String)
}

extension UserAPI: TargetType {
Expand All @@ -12,7 +13,7 @@ extension UserAPI: TargetType {

public var path: String {
switch self {
case .userInfoInput:
case .userInfoInput, .myInfo:
return "/user/profile"
}
}
Expand All @@ -21,6 +22,8 @@ extension UserAPI: TargetType {
switch self {
case .userInfoInput:
return .post
case .myInfo:
return .get
}
}

Expand All @@ -42,12 +45,14 @@ extension UserAPI: TargetType {
}

return .uploadMultipart(formData)
case .myInfo:
return .requestPlain
}
}

public var headers: [String : String]? {
switch self {
case .userInfoInput(let authorization, _, _, _):
case .userInfoInput(let authorization, _, _, _), .myInfo(let authorization):
return [
"Authorization": "Bearer \(authorization)"
]
Expand Down
Loading