feat: [client] Client API 사업자 정보 필드 및 toggle 버그 수정
- business_no, business_type, business_item 필드 추가 - toggle 로직 수정: boolean 캐스팅 호환 (is_active === 'Y' → !is_active)
This commit is contained in:
@@ -63,6 +63,9 @@ public function store(array $params)
|
||||
'phone' => 'nullable|string|max:30',
|
||||
'email' => 'nullable|email|max:80',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'business_no' => 'nullable|string|max:20',
|
||||
'business_type' => 'nullable|string|max:50',
|
||||
'business_item' => 'nullable|string|max:100',
|
||||
'is_active' => 'nullable|in:Y,N',
|
||||
]);
|
||||
|
||||
@@ -104,6 +107,9 @@ public function update(int $id, array $params)
|
||||
'phone' => 'nullable|string|max:30',
|
||||
'email' => 'nullable|email|max:80',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'business_no' => 'nullable|string|max:20',
|
||||
'business_type' => 'nullable|string|max:50',
|
||||
'business_item' => 'nullable|string|max:100',
|
||||
'is_active' => 'nullable|in:Y,N',
|
||||
]);
|
||||
|
||||
@@ -157,7 +163,8 @@ public function toggle(int $id)
|
||||
throw new NotFoundHttpException(__('error.not_found'));
|
||||
}
|
||||
|
||||
$client->is_active = $client->is_active === 'Y' ? 'N' : 'Y';
|
||||
// Model에서 is_active가 boolean으로 캐스팅되므로 boolean으로 토글
|
||||
$client->is_active = ! $client->is_active;
|
||||
$client->save();
|
||||
|
||||
return $client->refresh();
|
||||
|
||||
Reference in New Issue
Block a user