import { prisma } from "@/module/_global";
import { NextResponse } from "next/server";

export async function GET(request: Request) {
   try {
      const data = await prisma.setting.findMany({
         where: {
            isActive: true,
            id: {
               contains: "mobile_"
            }
         },
         select: {
            id: true,
            name: true,
            value: true
         }
      })

      return NextResponse.json({ success: true, data }, { status: 200 });
   } catch (error) {
      console.error(error);
      return NextResponse.json({ success: false, reason: (error as Error).message, }, { status: 500 });
   }
}