import { revertPublish } from "@/models/posts.model";
import { response } from "@/utils/helper";

export async function POST(request) {
  try {
    const data = await request.json();
    const result = await revertPublish(data.id);

    return response(200, "Revert post data successfully", result);
  } catch (error) {
    return response(500, "Internal Server Error", null, {
      error: "Failed to update data",
    });
  }
}
