-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Campaign Fixes #354
Campaign Fixes #354
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request makes targeted adjustments to the campaign-related components and hooks. In the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/entities/campaign/models/schema.ts (1)
5-5
: Unused import detected.The
futureTimestamp
function is imported but not used in this file. Consider removing it if it's not needed.-import { futureTimestamp } from "@/common/lib";
src/entities/campaign/hooks/forms.ts (2)
6-6
: Unused import detected.The
Temporal
import fromtemporal-polyfill
is added but not used in the code shown. Consider removing it if it's not needed.-import { Temporal } from "temporal-polyfill";
155-159
: Good enhancement to the start date logic.This change ensures that the
start_ms
field is only included in the submission if it's in the future or equal to the current time, which aligns with the schema validation. This fixes the start date bug mentioned in the PR description.However, consider adding error handling around
timeToMilliseconds
to handle invalid date formats:const timeToMilliseconds = (time: string) => { + if (!time) return 0; + const timestamp = new Date(time).getTime(); + return isNaN(timestamp) ? 0 : timestamp; - return new Date(time).getTime(); };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/entities/campaign/components/CampaignForm.tsx
(1 hunks)src/entities/campaign/hooks/forms.ts
(2 hunks)src/entities/campaign/models/schema.ts
(2 hunks)
🔇 Additional comments (2)
src/entities/campaign/components/CampaignForm.tsx (1)
63-63
: Good fix for preventing unnecessary rerenders.Removing
form
from the useEffect dependency array prevents the form values from being reset when the form state changes. This preserves user input once the form is initially populated from existing data.src/entities/campaign/models/schema.ts (1)
18-28
: Great addition of start date validation.This validation enhancement ensures that campaign start dates must be in the future, which directly addresses the bug mentioned in the PR description. This prevents users from creating campaigns with invalid start dates.
…into fix-start-date
* Implement generalized solution for cross-field validation (#352) * Fix referrer account id handling issues (#355) * Campaign Fixes (#354) * fixed issue with start date * es lint fix * change field to number field * es lint fix --------- Co-authored-by: Carina Akaia <cvo.akaia@gmail.com> --------- Co-authored-by: Carina.Akaia.org <cvo.akaia@gmail.com>
Summary by CodeRabbit