Modified API and created its tests
This commit is contained in:
@@ -30,9 +30,7 @@ Route::post('/siswa', function (Request $request) {
|
||||
|
||||
// Redirect with error if not found
|
||||
if (!$siswa || $siswa == null) {
|
||||
return redirect()->back()
|
||||
->withErrors(['siswa' => 'Siswa tidak ditemukan.'])
|
||||
->withInput();
|
||||
return response()->json(['siswa' => 'Siswa tidak ditemukan.'], 404);
|
||||
}
|
||||
|
||||
// Write to log
|
||||
|
||||
Reference in New Issue
Block a user