Skip to content

Off by one 179#213

Open
calebkeener13 wants to merge 5 commits intomainfrom
off-by-one-179
Open

Off by one 179#213
calebkeener13 wants to merge 5 commits intomainfrom
off-by-one-179

Conversation

@calebkeener13
Copy link
Contributor

Fixed the off by one issue by changing the logic for settinf finalStartDay and finalEndDay in the saveEdits function of newShiftPage.tsx

@netlify
Copy link

netlify bot commented Nov 18, 2025

Deploy Preview for bagel-rescue ready!

Name Link
🔨 Latest commit ad11098
🔍 Latest deploy log https://app.netlify.com/projects/bagel-rescue/deploys/691bc588f2230000085eb682
😎 Deploy Preview https://deploy-preview-213--bagel-rescue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 18, 2025

Disclaimer: This comment was AI-generated and is not necessarily completely accurate. Please take code comments with a grain of salt.

Greptile Summary

  • Fixed off-by-one date bug in shift creation by parsing date strings in local timezone instead of using Date constructor
  • Removed volunteer signup functionality including page, routes, and email links across multiple files

Confidence Score: 3/5

  • PR is mostly safe but contains unused database operations that need cleanup
  • The timezone fix is correct and improves reliability, but the email function still creates tokens in the database that are never used or cleaned up, leading to unnecessary data accumulation
  • Pay attention to src/server/db/actions/email.ts which creates unused database records

Important Files Changed

Filename Overview
src/app/AdminNavView/NewShiftPage/page.tsx Fixed timezone-related off-by-one date bug by parsing date strings in local time instead of using Date constructor directly, added disabled attribute to date inputs
src/server/db/actions/email.ts Removed signup link from volunteer invitation email, but function still creates unused tokens in database causing data accumulation

Sequence Diagram

sequenceDiagram
    participant User as "Admin User"
    participant UI as "NewShiftPage"
    participant DB as "Database"
    
    User->>UI: "Select date range and submit shift"
    UI->>UI: "Parse date strings in local time"
    UI->>UI: "Create Date objects with split values"
    UI->>DB: "Create shift with finalStartDay/finalEndDay"
    UI->>DB: "Create UserShift records for volunteers"
    DB-->>UI: "Success"
    UI->>User: "Redirect to DailyShiftDashboard"
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. src/server/db/actions/email.ts, line 118-120 (link)

    logic: tokens are created in the database but never used or cleaned up since signup page was deleted

10 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant