kesz feladat

This commit is contained in:
Krisztu
2026-02-22 11:23:44 +01:00
parent c887ccb658
commit f34d410c02
6 changed files with 60 additions and 76 deletions

View File

@@ -19,6 +19,7 @@ class poloController extends Controller
];
});
return response()->json($adatok,200,["Content-Type"=>"application/json"]);
}
/**
@@ -42,7 +43,14 @@ class poloController extends Controller
*/
public function update(Request $request, string $id)
{
//
$frissit = Polo::find($id);
if(!$frissit){
return response("Sikertelen frissítés",400);
}
$frissit->update([
"ar"=>$request["ar"]
]);
return response("Sikeres frissítés",200);
}
/**
@@ -50,6 +58,11 @@ class poloController extends Controller
*/
public function destroy(string $id)
{
//
$torlendo=Polo::find($id);
if(!$torlendo){
return response("Sikertelen törlés",404);
}
$torlendo->delete();
return response("",204);
}
}