import { cleanUpExpiredLockPost, getAllLockPost } from "@/models/posts.model";
import { NextResponse } from "next/server";

export async function GET() {
  try {
    // cleanup
    await cleanUpExpiredLockPost();

    const result = await getAllLockPost();
    return NextResponse.json(result, { status: 200 });
  } catch (error) {
    return NextResponse.json({ error: "Failed to get posts" }, { status: 500 });
  }
}
