Changed id type to uuid.

This commit is contained in:
Naida Vatric
2020-02-13 10:43:30 +01:00
parent 9c234a85fd
commit 9bcadffe9c
11 changed files with 72 additions and 39 deletions

View File

@@ -89,6 +89,16 @@ const createRealEstate = async (realEstateFields = {}) => {
return await db.RealEstate.create(realEstateFields);
};
const findRealEstateByAgencyId = async kiviId => {
try {
return db.RealEstate.findOne({
where: { agencyObjectId: kiviId }
});
} catch (error) {
console.log("realEstate.js", error);
return null;
}
};
const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
const {
priceMin,
@@ -354,5 +364,6 @@ module.exports = {
bulkUpsertRealEstates,
getRealEstateById,
createRealEstate,
findRealEstatesForSearchRequest
findRealEstatesForSearchRequest,
findRealEstateByAgencyId
};