feat: add GitHub username field and implement commit filtering by author in intern dashboard
This commit is contained in:
@@ -208,22 +208,35 @@ class CareerController extends Controller
|
||||
|
||||
$request->validate([
|
||||
'github_repo' => 'required|string|url|max:255',
|
||||
'github_username' => 'nullable|string|max:100',
|
||||
], [
|
||||
'github_repo.required' => 'Lütfen Github depo URL\'sini girin.',
|
||||
'github_repo.url' => 'Geçerli bir URL girilmelidir.',
|
||||
'github_repo.max' => 'Github depo URL\'si en fazla 255 karakter olabilir.',
|
||||
'github_username.max' => 'Github kullanıcı adı en fazla 100 karakter olabilir.',
|
||||
]);
|
||||
|
||||
$intern = CareerApplication::findOrFail(session('intern_id'));
|
||||
|
||||
// Sanitize & format github URL
|
||||
$repoUrl = trim($request->github_repo);
|
||||
$username = trim($request->github_username);
|
||||
|
||||
$intern->update([
|
||||
'github_repo' => $repoUrl
|
||||
'github_repo' => $repoUrl,
|
||||
'github_username' => $username ?: null,
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Github deposu başarıyla güncellendi.');
|
||||
if ($request->expectsJson() || $request->ajax()) {
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Github bilgileri başarıyla güncellendi.',
|
||||
'github_repo' => $repoUrl,
|
||||
'github_username' => $username ?: null,
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->back()->with('success', 'Github bilgileri başarıyla güncellendi.');
|
||||
}
|
||||
|
||||
public function downloadMarkdown()
|
||||
|
||||
@@ -30,6 +30,7 @@ class CareerApplication extends Model
|
||||
'internship_end_date',
|
||||
'internship_total_days',
|
||||
'github_repo',
|
||||
'github_username',
|
||||
'certificate_code',
|
||||
'transcript_markdown',
|
||||
'notebook_supervisor_signed',
|
||||
|
||||
Reference in New Issue
Block a user