<?php

namespace App\Http\Controllers\Master;

use App\Actions\Admin\Master\KomptKeahlianAction;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class KompetensiKeahlianController extends Controller
{
    protected $action;

    public function __construct(KomptKeahlianAction $action)
    {
        $this->action = $action;
    }

    public function store(Request $request)
    {
        return $this->action->create($request->all());
    }

    public function update($id, Request $request)
    {
        return $this->action->update($id, $request->all());
    }

    public function delete(Request $request)
    {
        $id = $request->input('id');
        return $this->action->delete($id);
    }

    public function mainTable(KomptKeahlianAction $action)
    {
        return $action->table();
    }
}
