import { NextResponse } from "next/server";
import { objectFilterEmpty } from "./library";

export const response = (status, message, data, error) => {
  return NextResponse.json(
    objectFilterEmpty({
      message: message || "Request successful.",
      data,
      error,
      version: process.env.APP_VERSION || "1.0.0",
    }),
    { status: status }
  );
};
