Skip to content

Commit

Permalink
fresh product with null title
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 21, 2024
1 parent 4b8c208 commit 1a624c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/features/need/need.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export class NeedController {
fetchedNeed.category !== need.category ||
fetchedNeed.type !== need.type ||
fetchedNeed.details !== need.details ||
fetchedNeed.title !== need.title ||
fetchedNeed.information !== need.informations ||
fetchedNeed.nameTranslations.en !== need.name_translations.en
) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/needConfirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const BASE_AGE_OF_DUPLICATE_0 = 30;
const BASE_AGE_OF_DUPLICATE_1 = 30;
const BASE_AGE_OF_DUPLICATE_2 = 30;
const BASE_AGE_OF_DUPLICATE_3 = 30;

const MIN_TITLE_LENGTH = 5;
const SIMILAR_URL_PERCENTAGE = 57; // percentage
const SIMILAR_TXT_PERCENTAGE = 10; // percentage
export const SIMILAR_NAME_LIMIT_PRODUCT = 20;
Expand Down Expand Up @@ -302,7 +302,7 @@ export async function validateNeed(
message: `Automated Message: Please check ${
price < 500
? 'Price'
: type === NeedTypeEnum.PRODUCT && (!title || title.length < 5)
: type === NeedTypeEnum.PRODUCT && (!title || title.length < MIN_TITLE_LENGTH)
? 'Title'
: !name_en || name_en.length < 3
? 'Name'
Expand Down

0 comments on commit 1a624c5

Please sign in to comment.