import GeneralSettings from "@/models/GeneralSettings";
import dbConnect from "@/lib/mongodb";
import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest){
    try{
         await dbConnect();
         const generalsettings=await GeneralSettings.find().lean();
         return NextResponse.json({
            success:true,
            data:generalsettings
         })
    }catch(error:any){
       return NextResponse.json(
            {
              success: false,
              error:
                'Internal Server Error',
            },
            { status: 500 }
          );
    }
}