Example #1
0
 public function removeTagRelation(Request $request)
 {
     $tagService = new tagService();
     $typeId = $request->input('typeId');
     $tagId = $request->input('id');
     $parentId = $request->input('parentId');
     $return['ok'] = 0;
     try {
         if ($typeId && $tagId) {
             $return['ok'] = 1;
             $return['data'] = $tagService->removeTagRelation($tagId, $typeId, $parentId);
             $tagService->resetTagOrder($parentId, $typeId);
         }
     } catch (\Exception $e) {
         // @codeCoverageIgnoreStart
         $return['error'] = $e->getMessage();
         $return['errorMsg'] = $e->getMessage();
         // @codeCoverageIgnoreEnd
     }
     return response()->json($return);
 }