Commit 86720494 by Aan Choesni Herlingga

delete data translation

parent 825e3be2
......@@ -143,9 +143,13 @@ class CategoryController extends Controller
*/
public function destroy($id)
{
$data = $this->repo->findId($id);
$data = $this->repo->findId($id, ['rEn']);
$this->repo->destroy($data);
if ($data->rEn) {
$this->repoEn->destroy($data->rEn);
}
return response()->json(['done']);
}
}
......@@ -158,9 +158,13 @@ class InformationController extends Controller
*/
public function destroy($id)
{
$data = $this->repo->findId($id);
$data = $this->repo->findId($id, ['rEn']);
$this->repo->destroy($data);
if ($data->rEn) {
$this->repoEn->destroy($data->rEn);
}
return response()->json(['done']);
}
}
......@@ -154,9 +154,13 @@ class PageController extends Controller
*/
public function destroy($id)
{
$data = $this->repo->findId($id);
$data = $this->repo->findId($id, ['rEn']);
$this->repo->destroy($data);
if ($data->rEn) {
$this->repoEn->destroy($data->rEn);
}
return response()->json(['done']);
}
}
......@@ -161,9 +161,13 @@ class PostController extends Controller
*/
public function destroy($id)
{
$data = $this->repo->findId($id);
$data = $this->repo->findId($id, ['rEn']);
$this->repo->destroy($data);
if ($data->rEn) {
$this->repoEn->destroy($data->rEn);
}
return response()->json(['done']);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment