testing yuk

This commit is contained in:
Randa Firman Putra
2025-09-14 16:59:31 +07:00
parent 248fed0d0b
commit 60211ae829
63 changed files with 315 additions and 315 deletions

View File

@@ -1,10 +1,10 @@
import { NextRequest, NextResponse } from 'next/server';
import supabase from '@/lib/db';
// GET - Fetch all unique jenis_pendaftaran values
// GET - Ambil semua nilai jenis_pendaftaran yang unik
export async function GET() {
try {
// Get all unique jenis_pendaftaran values
// Ambil semua nilai jenis_pendaftaran yang unik
const { data, error } = await supabase
.from('mahasiswa')
.select('jenis_pendaftaran')
@@ -16,7 +16,7 @@ export async function GET() {
return NextResponse.json({ message: 'Internal Server Error' }, { status: 500 });
}
// Get unique values
// Ambil nilai unik
const uniqueValues = [...new Set(data.map(item => item.jenis_pendaftaran))];
return NextResponse.json(uniqueValues.map(value => ({ jenis_pendaftaran: value })));
@@ -26,13 +26,13 @@ export async function GET() {
}
}
// PUT - Update jenis_pendaftaran value
// PUT - Update nilai jenis_pendaftaran
export async function PUT(request: NextRequest) {
try {
const body = await request.json();
const { oldValue, newValue } = body;
// Validate required fields
// Validasi field yang wajib diisi
if (!oldValue || !newValue) {
return NextResponse.json(
{ message: 'Missing required fields: oldValue, newValue' },