refactored loadMaterials vuex mixins with graphql
This commit is contained in:
@@ -50,18 +50,18 @@ class MaterioFlagActionsController extends ActionLinkController {
|
||||
public function flaglistentity(Request $request) {
|
||||
$post_data = json_decode( $request->getContent(),TRUE);
|
||||
$flagid = $post_data['flagid'];
|
||||
$uuid = $post_data['uuid'];
|
||||
$id = $post_data['id'];
|
||||
$flagcollid = $post_data['flagcollid'];
|
||||
|
||||
// $flagcoll = $this->flagListsService->getFlaggingCollectionById($flagcollid);
|
||||
// $flag = $flagcoll->getRelatedFlag();
|
||||
$flag = $this->flagService->getFlagById($flagid);
|
||||
|
||||
$node = \Drupal::service('entity.repository')->loadEntityByUuid('node', $uuid);
|
||||
$nid = $node->id();
|
||||
// $node = \Drupal::service('entity.repository')->loadEntityByUuid('node', $uuid);
|
||||
// $nid = $node->id();
|
||||
|
||||
// call the parent flag function
|
||||
$this->flag($flag, $nid, $flagcollid);
|
||||
$this->flag($flag, $id, $flagcollid);
|
||||
|
||||
// // OR rewrite it entirely
|
||||
// $entity = $this->flagService->getFlaggableById($flag, $nid);
|
||||
@@ -82,8 +82,8 @@ class MaterioFlagActionsController extends ActionLinkController {
|
||||
$data = [
|
||||
'flag' => $flag->toArray(),
|
||||
'flagid' => $flagid,
|
||||
'entity_id' => $nid,
|
||||
'entity_uuid' => $uuid,
|
||||
'entity_id' => $id,
|
||||
// 'entity_uuid' => $uuid,
|
||||
'flagcollid' => $flagcollid,
|
||||
// 'post_data' => $post_data,
|
||||
// 'flaggableEntityTypeId' => $flag->getFlaggableEntityTypeId(),
|
||||
@@ -96,21 +96,21 @@ class MaterioFlagActionsController extends ActionLinkController {
|
||||
public function unFlaglistentity(Request $request) {
|
||||
$post_data = json_decode( $request->getContent(),TRUE);
|
||||
$flagid = $post_data['flagid'];
|
||||
$uuid = $post_data['uuid'];
|
||||
$id = $post_data['id'];
|
||||
$flagcollid = $post_data['flagcollid'];
|
||||
// get flag
|
||||
$flag = $this->flagService->getFlagById($flagid);
|
||||
// get the nid from uuid
|
||||
$node = \Drupal::service('entity.repository')->loadEntityByUuid('node', $uuid);
|
||||
$nid = $node->id();
|
||||
// $node = \Drupal::service('entity.repository')->loadEntityByUuid('node', $uuid);
|
||||
// $nid = $node->id();
|
||||
// call the parent flag function
|
||||
$this->unflag($flag, $nid, $flagcollid);
|
||||
$this->unflag($flag, $id, $flagcollid);
|
||||
// response
|
||||
$data = [
|
||||
'flag' => $flag->toArray(),
|
||||
'flagid' => $flagid,
|
||||
'entity_id' => $nid,
|
||||
'entity_uuid' => $uuid,
|
||||
'entity_id' => $id,
|
||||
// 'entity_uuid' => $uuid,
|
||||
'flagcollid' => $flagcollid,
|
||||
];
|
||||
return new JsonResponse($data);
|
||||
|
Reference in New Issue
Block a user