Skip to content

Commit

Permalink
Merge pull request #584 from TeamNado-Sunbae/chore/#580-EditProfile
Browse files Browse the repository at this point in the history
βœ… [CHORE] ν”„λ‘œν•„ μˆ˜μ • λ·° 정상화
  • Loading branch information
dev-jungbin authored Oct 26, 2022
2 parents 446a19a + c3df23c commit a4a56c8
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MypageSettingAPI {
private init() {}

/// [PUT] ν”„λ‘œν•„ μˆ˜μ •
func editProfile(data: EditProfileRequestModel, completion: @escaping (NetworkResult<Any>) -> (Void)) {
func editProfile(data: MypageEditProfileRequestBodyModel, completion: @escaping (NetworkResult<Any>) -> (Void)) {
provider.request(.editProfile(data: data)) { result in
switch result {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// MypageEditProfileBodyModel.swift
// NadoSunbae
//
// Created by madilyn on 2022/10/26.
//

import Foundation

struct MypageEditProfileRequestBodyModel: Codable, Equatable {
var profileImageID: Int = 1
var nickname: String = ""
var bio: String = ""
var isOnQuestion: Bool = false
var firstMajorName: String? = ""
var firstMajorID: Int = 0
var firstMajorStart: String = ""
var secondMajorName: String? = ""
var secondMajorID: Int = 0
var secondMajorStart: String = ""

enum CodingKeys: String, CodingKey {
case profileImageID = "profileImageId"
case nickname, bio, isOnQuestion
case firstMajorID = "firstMajorId"
case firstMajorStart
case secondMajorID = "secondMajorId"
case secondMajorStart
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
import Moya

enum MypageSettingService {
case editProfile(data: EditProfileRequestModel)
case editProfile(data: MypageEditProfileRequestBodyModel)
case getLatestVersion
case getBlockList
case requestResetPW(email: String)
Expand All @@ -23,7 +23,7 @@ extension MypageSettingService: TargetType {
var path: String {
switch self {
case .editProfile:
return "/user/mypage"
return "/user/"
case .getLatestVersion:
return "/app/version/recent"
case .getBlockList:
Expand All @@ -48,12 +48,14 @@ extension MypageSettingService: TargetType {
switch self {
case .editProfile(let data):
return .requestParameters(parameters: [
"nickname": data.nickName,
"profileImageId": data.profileImageID,
"nickname": data.nickname,
"bio": data.bio,
"isOnQuestion": data.isOnQuestion,
"firstMajorId": data.firstMajorID,
"firstMajorStart": data.firstMajorStart,
"secondMajorId": data.secondMajorID,
"secondMajorStart": data.secondMajorStart,
"isOnQuestion": data.isOnQuestion
"secondMajorStart": data.secondMajorStart
], encoding: JSONEncoding.default)
case .getLatestVersion, .getBlockList:
return .requestPlain
Expand Down
Loading

0 comments on commit a4a56c8

Please sign in to comment.