From eb8c4f55a6de51b2556d68b32922731f36d3761d Mon Sep 17 00:00:00 2001 From: Randa Firman Putra Date: Mon, 25 Aug 2025 22:38:49 +0700 Subject: [PATCH] kesekian kali --- app/api/keloladata/kelompok-keahlian/route.ts | 3 ++- app/dashboard/page.tsx | 2 +- app/page.tsx | 2 +- components/chartsDashboard/kkdashboardchart.tsx | 4 ++-- components/datatable/data-table-prestasi-mahasiswa.tsx | 2 ++ components/datatable/upload-file-prestasi-mahasiswa.tsx | 1 - fix_sequence.sql | 1 + 7 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 fix_sequence.sql diff --git a/app/api/keloladata/kelompok-keahlian/route.ts b/app/api/keloladata/kelompok-keahlian/route.ts index 18dbc60..403d583 100644 --- a/app/api/keloladata/kelompok-keahlian/route.ts +++ b/app/api/keloladata/kelompok-keahlian/route.ts @@ -60,6 +60,7 @@ export async function POST(request: NextRequest) { ); } + // Insert without specifying id_kk to let the database auto-generate it const { data, error } = await supabase .from('kelompok_keahlian') .insert([{ nama_kelompok: nama_kelompok.trim() }]) @@ -211,4 +212,4 @@ export async function DELETE(request: NextRequest) { { status: 500 } ); } -} +} \ No newline at end of file diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 5b6937b..641395b 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -28,7 +28,7 @@ export default function TotalMahasiswaPage() {

- Visualisasi data akademik mahasiswa Informartika Universitas Tanjungpura + Visualisasi Data Akademik Mahasiswa Informatika Universitas Tanjungpura

diff --git a/app/page.tsx b/app/page.tsx index b78e953..971842b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -104,7 +104,7 @@ export default function DashboardPage() { return (
-

Visualisasi Data Mahasiswa Informatika

+

Visualisasi Data Akademik Mahasiswa Informatika

{loading ? (
diff --git a/components/chartsDashboard/kkdashboardchart.tsx b/components/chartsDashboard/kkdashboardchart.tsx index 16ae973..e786db2 100644 --- a/components/chartsDashboard/kkdashboardchart.tsx +++ b/components/chartsDashboard/kkdashboardchart.tsx @@ -102,7 +102,7 @@ export default function KelompokKeahlianStatusChart({ selectedYear }: Props) { xaxis: { categories: years.map(y => y.toString()), title: { - text: 'Tahun Angkatan', + text: 'Jumlah Mahasiswa', style: { fontSize: '14px', fontWeight: 'bold', @@ -118,7 +118,7 @@ export default function KelompokKeahlianStatusChart({ selectedYear }: Props) { }, yaxis: { title: { - text: 'Jumlah Mahasiswa', + text: 'Tahun Angkatan', style: { fontSize: '14px', fontWeight: 'bold', diff --git a/components/datatable/data-table-prestasi-mahasiswa.tsx b/components/datatable/data-table-prestasi-mahasiswa.tsx index 780f6a0..269747a 100644 --- a/components/datatable/data-table-prestasi-mahasiswa.tsx +++ b/components/datatable/data-table-prestasi-mahasiswa.tsx @@ -278,8 +278,10 @@ export default function DataTablePrestasiMahasiswa() { if (!response.ok) { // Handle specific NIM not found error if (response.status === 404 && responseData.message.includes("tidak terdaftar")) { + showError("Gagal!", `NIM ${formData.nim} tidak terdaftar`); throw new Error(`NIM ${formData.nim} tidak terdaftar dalam database. Silakan cek kembali NIM yang dimasukkan.`); } + showError("Gagal!", responseData.message || "Failed to add prestasi"); throw new Error(responseData.message || "Failed to add prestasi"); } diff --git a/components/datatable/upload-file-prestasi-mahasiswa.tsx b/components/datatable/upload-file-prestasi-mahasiswa.tsx index b48fe10..3a99b4a 100644 --- a/components/datatable/upload-file-prestasi-mahasiswa.tsx +++ b/components/datatable/upload-file-prestasi-mahasiswa.tsx @@ -119,7 +119,6 @@ export default function UploadFilePrestasiMahasiswa({ onUploadSuccess }: UploadF

Upload file Excel (.xlsx, .xls) atau CSV (.csv)

-

Format kolom: NIM, Jenis Prestasi, Nama Prestasi, Tingkat Prestasi, Peringkat, Tanggal (DD-MM-YYYY, DD/MM/YYYY, atau YYYY-MM-DD)

diff --git a/fix_sequence.sql b/fix_sequence.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/fix_sequence.sql @@ -0,0 +1 @@ +