import { getSession } from "../lib/neo4j.js";
export async function profileDelete(params) {
    const { accountId, userId, category, key } = params;
    const session = getSession();
    try {
        const result = await session.run(`
      MATCH (up:UserProfile {accountId: $accountId, userId: $userId})-[:HAS_PREFERENCE]->(pref:Preference {category: $category, key: $key})
      DETACH DELETE pref
      RETURN count(*) AS deleted
      `, { accountId, userId, category, key });
        const deletedCount = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
        return { deleted: deletedCount > 0, category, key };
    }
    finally {
        await session.close();
    }
}
//# sourceMappingURL=profile-delete.js.map