<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Skp2Ver;
use App\Models\KategoriSKP;
use App\DataTables\Mahasiswa\SkpDataTable;

class SkpController extends Controller
{
    public function index(SkpDataTable $dataTable)
    {
        $kategoriSkp = KategoriSKP::with('kegiatan_skp')->get();
        
        return $dataTable->render('admin.kolokium.skp', compact('kategoriSkp'));
    }

    public function update(Request $request, $id)
    {
        $skp = Skp2Ver::find($id);

        $skp->update([
            'status' => $request->status,
            'keterangan' => $request->keterangan,
            'poin' => $request->poin,
        ]);

        return response()->json();
    }
}
