Skip to content

Commit

Permalink
[Edit] 유저 프로필 URL 업데이트 메서드 #166
Browse files Browse the repository at this point in the history
필드데이터 업데이트 시, URL 타입으로 보냈더니 오류가 났음 ( 파베 오류 )
- url.absoluteString 으로 String 으로 보내서 저장.
  • Loading branch information
Phangg committed Mar 20, 2024
1 parent 54d8aae commit 09854bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions JUDA_iOS/JUDA/ViewModel/Auth/FirebaseAuthService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ extension FirebaseAuthService {
print("error :: updateUserFcmToken", error.localizedDescription)
}
}

// firestore 에서 유저 프로필 url 변경
func updateUserProfileImageURL(uid: String, url: URL) async {
do {
let docRef = db.collection(userCollection).document(uid)
try await docRef.updateData(["profileImageURL": url.absoluteString])
} catch {
print("error :: updateUserProfileImageURL", error.localizedDescription)
}
}
}

// MARK: - 데이터 실시간 업데이트
Expand Down

0 comments on commit 09854bf

Please sign in to comment.