Fix invalid edit/delete paths on crud lists

This commit is contained in:
Ramon Gutierrez 2018-01-09 02:03:48 +08:00
parent a43cb4a0db
commit 0b5862e4d4
2 changed files with 5 additions and 14 deletions

View file

@ -82,12 +82,6 @@ class RoleController extends BaseController
->getQuery()
->getResult(Query::HYDRATE_ARRAY);
// response
return $this->json([
'meta' => $meta,
'data' => $rows
]);
// add crud urls
foreach ($rows as $index => $row) {
$rows[$index]['update_url'] = $this->generateUrl('role_update', ['id' => $row['id']]);

View file

@ -35,7 +35,7 @@ class UserController extends BaseController
$qb = $this->getDoctrine()
->getRepository(User::class)
->createQueryBuilder('q');
// count total records
$total = $qb->select('COUNT(q)')
->getQuery()
@ -87,12 +87,6 @@ class UserController extends BaseController
->getQuery()
->getResult(Query::HYDRATE_ARRAY);
// response
return $this->json([
'meta' => $meta,
'data' => $rows
]);
// add crud urls
foreach ($rows as $index => $row) {
$rows[$index]['update_url'] = $this->generateUrl('user_update', ['id' => $row['id']]);
@ -100,7 +94,10 @@ class UserController extends BaseController
}
// response
return $this->json(['data' => $rows]);
return $this->json([
'meta' => $meta,
'data' => $rows
]);
}
public function create()