feat:회원사 수정 시 비밀번호 업데이트 기능 추가
- 수정 모달에서 비밀번호 선택적 입력 가능 - 기존 Hash 저장 데이터를 새로운 encrypted 방식으로 업데이트 가능 - 비밀번호 입력 시에만 업데이트, 빈 값이면 기존 유지
This commit is contained in:
@@ -198,6 +198,8 @@ public function show(Request $request, int $id): JsonResponse
|
||||
|
||||
/**
|
||||
* 회원사 수정
|
||||
*
|
||||
* 비밀번호는 선택적으로 업데이트 가능 (기존 Hash 저장 데이터 호환)
|
||||
*/
|
||||
public function update(Request $request, int $id): JsonResponse
|
||||
{
|
||||
@@ -220,8 +222,14 @@ public function update(Request $request, int $id): JsonResponse
|
||||
'manager_email' => 'nullable|email|max:100',
|
||||
'manager_hp' => 'nullable|string|max:20',
|
||||
'status' => 'nullable|in:active,inactive,pending',
|
||||
'barobill_pwd' => 'nullable|string|max:255', // 비밀번호 선택적 업데이트
|
||||
]);
|
||||
|
||||
// 비밀번호가 비어있으면 제외 (기존 값 유지)
|
||||
if (empty($validated['barobill_pwd'])) {
|
||||
unset($validated['barobill_pwd']);
|
||||
}
|
||||
|
||||
$member->update($validated);
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user