<?php

namespace App\Http\Controllers\buildable;

use Fivable\Buildable\Controllers\BuildableComponentController as BaseBuildableComponentController;

class BuildableComponentController extends BaseBuildableComponentController
{

//    /**
//     * Get a specific BuildableComponent
//     * @param  BuildableComponent  $buildableComponent
//     * @return JsonResponse
//     */
//    public function show(BuildableComponent $buildableComponent) : JsonResponse
//    {
//        $this->authorizeForUser($this->user(), 'view', $buildableComponent);
//
//        return response()->json([
//            'component' => $buildableComponent,
//        ]);
//    }

//    /**
//     * Create a new BuildableComponent
//     * @param  Request  $request
//     * @return JsonResponse
//     */
//    public function store(Request $request) : JsonResponse
//    {
//        $this->authorizeForUser($this->user(), 'create', BuildableComponent::class);
//
//        $newComponent = BuildableComponent::create($request->all());
//
//        return response()->json([
//            'new_component' => $newComponent,
//        ]);
//    }

//    /**
//     * Update a specific BuildableComponent
//     * @param  Request  $request
//     * @param  BuildableComponent  $buildableComponent
//     * @return JsonResponse
//     */
//    public function update(Request $request, BuildableComponent $buildableComponent) : JsonResponse
//    {
//        $this->authorizeForUser($this->user(), 'update', $buildableComponent);
//
//        // TODO: Add logic to BuildableComponent update to unlink if non-customizable vault component field is changed.
//        // TODO: Maybe don't allow Editors to break linked components?
//        $buildableComponent->update($request->all());
//
//        return response()->json([
//            'updated_component' => $buildableComponent->fresh(),
//        ]);
//    }

//    /**
//     * Delete a specific BuildableComponent
//     * @param  BuildableComponent  $buildableComponent
//     * @return JsonResponse
//     * @throws \Exception
//     */
//    public function destroy(BuildableComponent $buildableComponent) : JsonResponse
//    {
//        $this->authorizeForUser($this->user(), 'delete', $buildableComponent);
//
//        $buildableComponent->delete();
//
//        return response()->json([
//            'deleted_component' => $buildableComponent,
//        ]);
//    }
}
