Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[baki/week10] Network(2) #75

Merged
merged 2 commits into from
Jul 20, 2024
Merged

[baki/week10] Network(2) #75

merged 2 commits into from
Jul 20, 2024

Conversation

heemings
Copy link
Contributor

@heemings heemings commented Jul 3, 2024

๐Ÿ“Summary

๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž…, ์ž๋™๋กœ๊ทธ์ธ ๊ตฌํ˜„

๐Ÿ’กPR Point

func loginAPI(id: String, password: String, completion: @escaping (Bool) -> Void) {
        provider.request(.login(id: id, password: password)) { result in
            DispatchQueue.main.async {
                switch result {
                case let .success(response):
                    if let tokenResponse = try? response.map(TokenResponse.self) {
                        TokenManager.shared.accessToken = tokenResponse.access_token
                        TokenManager.shared.refreshToken = tokenResponse.refresh_token
                        completion(true)
                    } else {
                        completion(false)
                    }
                case .failure:
                    completion(false)
                }
            }
        }
    }

์ด ๋ถ€๋ถ„์ด ๊ฐ€์žฅ ์–ด๋ ต๊ฒŒ ๋Š๊ปด์กŒ๋Š”๋ฐ ์ฐจ๋ก€๋Œ€๋กœ ๋”ฐ๋ผ๊ฐ€๋ฉด์„œ ๊ณต๋ถ€ํ•ด๋ณด๋‹ˆ ๋กœ๊ทธ์ธ ๋กœ์ง์— ๋Œ€ํ•ด ์ดํ•ดํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค

๐Ÿค” Question

์ž‘์—…ํ•˜์‹œ๋ฉด์„œ ๊ถ๊ธˆํ–ˆ๋˜ ์งˆ๋ฌธ๋“ค์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”.

๐Ÿ”‘ย Simulator

Simulator Screen Recording - iPhone 15 Pro - 2024-07-03 at 19 22 08

@heemings heemings self-assigned this Jul 3, 2024
@heemings heemings added the ch10 label Jul 3, 2024
@jayn2u jayn2u merged commit 9febf88 into main Jul 20, 2024
@jayn2u jayn2u deleted the baki/week10 branch July 20, 2024 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants