Compare commits

...

5 Commits

Author SHA1 Message Date
Naida Vatric
81fa3f046d Default true for include incomplete ads. 2020-02-15 00:52:06 +01:00
Senad Uka
fc7fe3c0b3 Notificaton service disabled 2020-02-14 15:07:42 +01:00
Naida Vatric
b3007123a5 Merge branch 'rename-settings-var' into 'master'
Rename settings var

See merge request saburly/marketalarm/web!93
2020-02-10 20:17:08 +00:00
Naida Vatric
f7d4a9cd07 Renamed settings var to describe purpose. 2020-02-10 21:15:28 +01:00
Naida Vatric
ab6812889a Merge branch 'fixing-saljic-bugs' into 'master'
Fixing saljic bugs

See merge request saburly/marketalarm/web!92
2020-02-09 18:11:00 +00:00
6 changed files with 40 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ const APP_URL =
? process.env.APP_URL || "http://market-alarm"
: process.env.APP_URL || `${APP_BASE_URL}:${APP_PORT}`;
const STAGING = process.env.SETTINGS !== "production";
const STAGING = process.env.ENVIRONMENT !== "production";
const DEFAULT_TIMEZONE = "Europe/Sarajevo";
@@ -55,5 +55,4 @@ module.exports = {
STAGING,
CHECK_UP_DAYS,
PROSTOR_LOGIN
};

View File

@@ -332,10 +332,14 @@ const findRealEstatesForSearchRequest = async (searchRequest, maxResults) => {
};
}
//When includeIncompleteAds are not defined - null it will consider it true
const order = [["updatedAt", "desc"]];
return db.RealEstate.findAll({
where: includeIncompleteAds ? queryIncludeIncomplete : query,
where:
includeIncompleteAds || includeIncompleteAds == null
? queryIncludeIncomplete
: query,
limit: maxResults,
order
});

View File

@@ -157,7 +157,7 @@ const findSearchRequestsForRealEstate = async realEstate => {
} else {
// If real estate dont have defined number of rooms ex. null
//It returns requests that didn't choose number of rooms - also null
//Or ones that picked some values but also picked to includeIncomplete ads
//Or ones that picked some values but also picked to includeIncomplete ads (or default)
numberOfRoomsQuery = {
[Op.or]: [
{
@@ -176,7 +176,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -226,7 +229,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -275,7 +281,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -313,7 +322,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -347,7 +359,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -381,7 +396,10 @@ const findSearchRequestsForRealEstate = async realEstate => {
},
{
includeIncompleteAds: {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
}
}
]
@@ -423,10 +441,13 @@ const findSearchRequestsForRealEstate = async realEstate => {
[Op.eq]: "ANY"
};
}
//Tag to check if incomplete ads are accepted in query
//Tag to check if incomplete ads are accepted in query which is default
if (checkForIncompleteWanted) {
query.includeIncompleteAds = {
[Op.eq]: true
[Op.or]: {
[Op.eq]: true,
[Op.is]: null
}
};
}

View File

@@ -131,7 +131,7 @@ const notifyRequestsWithDailyOption = async () => {
};
const checkUpNotify = async () => {
const searchRequestsForCheckUp = await findAllRequestsForCheckUp();
/* const searchRequestsForCheckUp = await findAllRequestsForCheckUp();
const asyncSendEmailActions = [];
@@ -144,7 +144,7 @@ const checkUpNotify = async () => {
asyncSendEmailActions.push(sendEmailPromise);
sendEmailPromise.catch(err => console.log("[Email Sending Failed]", err));
}
await Promise.all(asyncSendEmailActions);
await Promise.all(asyncSendEmailActions); */
};
module.exports = {

View File

@@ -61,9 +61,8 @@
<p class="distinguished">
<label class="checkbox-label">
<input type="checkbox" class="filled-in" name="includeIncompleteAds"
<% if (includeIncompleteAds) { %>
checked
<% } %>>
>
<span>Uključi i oglase bez potpunih informacija</span>
</label>
</p>

View File

@@ -8,7 +8,7 @@ SEQUELIZE_LOGGING=0- no sequelize logging, 1- log to the console
PORT=Port for the app, defaults to 5000
APP_BASE_URL=base url for the app
SETTINGS=Variable to denote development, staging and production
ENVIRONMENT=Variable to denote development, staging and production
MAX_REAL_ESTATES_IN_EMAIL=Max number of real estates that will be shown in email, others will be truncated and URL with full list will be shwon