Compare commits

..

No commits in common. "be1bd0541c2cd1ed9d0e1b3391f8548ee3ce7e24" and "ffcdd4600336ec4e6d5373f6a19a816479eea1db" have entirely different histories.

3 changed files with 5 additions and 64 deletions

View File

@ -17,42 +17,4 @@ class AffectationController extends AbstractController
'controller_name' => 'AffectationController', 'controller_name' => 'AffectationController',
]); ]);
} }
public function add(Request $request)
{
$validated = $request->validate([
'name' => 'required|string|max:255',
'description' => 'nullable|string',
]);
$affectation = Affectation::create($validated);
return response()->json([
'message' => 'Affectation réussie',
'data' => $affectation
], 201);
}
public function list()
{
$affectations = Affectation::all();
return response()->json([
'data' => $affectations
], 200);
}
public function delete($id)
{
$affectation = Affectation::find($id);
if (!$affectation) {
return response()->json(['message' => ''], 404);
}
$affectation->delete();
return response()->json(['message' => ''], 200);
}
} }

View File

@ -1,21 +0,0 @@
{% extends 'base.html.twig' %}
{% block title %}Affectation{% endblock %}
{% block body %}
<div class="wrapper">
<h1>Affectation des utilisateurs.</h1>
{% for employee in employees %}
<tr>
<td>{{ employee.id }}</td>
</tr>
{% else %}
<tr>
<td colspan="7">no records found</td>
</tr>
</div>
{% endblock %}

View File

@ -7,11 +7,11 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
<th>Label</th> <th>Label</th>
<th>actions</th> <th>actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for category in categories %} {% for category in categories %}