-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: schedule closing date #4433
base: main
Are you sure you want to change the base?
Conversation
🧪 Review environmenthttps://xmdnzu6er2w23acunbkcjfimne0bqktr.lambda-url.ca-central-1.on.aws/ |
const saveFormStatus = useCallback(async () => { | ||
let closeDate = "open"; | ||
let closeDate = "open"; // this wil reset the closing date to null; |
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.
We can pass just null
vs "open" here and update the server action but we need to check of the closing date is already set in the future before we null out the date.
Originally I was passing open to avoid any potential JS type coercion with the API call --- which is now gone and replaced with a server action.
@@ -46,7 +46,17 @@ export const SetClosingDate = ({ | |||
return true; | |||
}, [closedMessage]); | |||
|
|||
const [status, setStatus] = useState(closingDate ? "closed" : "open"); | |||
// TODO: not working, needs more work | |||
const isPastDate = useCallback( |
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.
Can use the dateHasPast util func here
const isPastClosingDate = dateHasPast(Date.parse(closingDate));
Summary | Résumé
TODO