diff --git a/apps/api/src/app/models/Quest.ts b/apps/api/src/app/models/Quest.ts index f731aa4fe..1a22dae83 100644 --- a/apps/api/src/app/models/Quest.ts +++ b/apps/api/src/app/models/Quest.ts @@ -8,8 +8,9 @@ export const questSchema = { index: Number, expiryDate: Date, infoLinks: [{ label: String, url: String }], - isPublished: { type: Boolean, default: false }, locks: { type: [{ questId: String, variant: Number }], default: [] }, + isPublished: { type: Boolean, default: false }, + isIPLimitEnabled: { type: Boolean, default: false }, }; export const questEntrySchema = { diff --git a/apps/api/src/app/services/QuestService.ts b/apps/api/src/app/services/QuestService.ts index 63d640afc..008babb38 100644 --- a/apps/api/src/app/services/QuestService.ts +++ b/apps/api/src/app/services/QuestService.ts @@ -183,7 +183,7 @@ export default class QuestService { variant: QuestVariant, options: { quest: TQuest; account: TAccount; data: Partial }, ) { - if (options.data.ip) { + if (options.quest.isIPLimitEnabled) { const ONE_DAY_MS = 86400 * 1000; // 24 hours in milliseconds const now = Date.now(), start = now - ONE_DAY_MS, diff --git a/libs/common/src/lib/types/Quest.d.ts b/libs/common/src/lib/types/Quest.d.ts index ea23626d1..eaacfd36d 100644 --- a/libs/common/src/lib/types/Quest.d.ts +++ b/libs/common/src/lib/types/Quest.d.ts @@ -38,6 +38,7 @@ type TBaseQuest = { expiryDate: Date; locks: TQuestLock[]; isPublished: boolean; + isIPLimitEnabled: boolean; createdAt: string; updatedAt: string; update: (payload: Partial) => Promise;