feat: Phase 5.1-1 사용자 초대 + Phase 5.2 알림 설정 API 연동
- 사용자 초대 API: role 문자열 지원 추가 (React 호환) - 알림 설정 API: 그룹 기반 계층 구조 구현 - notification_setting_groups 테이블 추가 - notification_setting_group_items 테이블 추가 - notification_setting_group_states 테이블 추가 - GET/PUT /api/v1/settings/notifications 엔드포인트 추가 - Pint 코드 스타일 정리
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
use App\Models\Members\User;
|
||||
use App\Models\Members\UserTenant;
|
||||
use App\Models\Permissions\Role;
|
||||
use App\Models\UserInvitation;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -56,6 +57,14 @@ public function invite(array $data): UserInvitation
|
||||
$tenantId = $this->tenantId();
|
||||
$userId = $this->apiUserId();
|
||||
|
||||
// role 문자열 → role_id 변환 (React 호환)
|
||||
if (! empty($data['role']) && empty($data['role_id'])) {
|
||||
$role = Role::where('name', $data['role'])
|
||||
->where('tenant_id', $tenantId)
|
||||
->first();
|
||||
$data['role_id'] = $role?->id;
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($data, $tenantId, $userId) {
|
||||
$email = $data['email'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user