14 lines
502 B
TypeScript
14 lines
502 B
TypeScript
import { Property } from "../../db/mysql/db.config";
|
|
import { groupSimilarProperties } from "../../services/fusejs/filterProperties";
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
try {
|
|
const candidateProperties = await Property.findAll();
|
|
const properties = groupSimilarProperties(candidateProperties);
|
|
return { success: true, properties };
|
|
} catch (error) {
|
|
console.error("Error listing properties:", error);
|
|
return { success: false, message: error.message };
|
|
}
|
|
});
|