mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-12 14:20:08 +02:00
Add volunteerDayWishesSet in store
This commit is contained in:
@@ -28,17 +28,17 @@ const HomePage: FC<Props> = (): JSX.Element => {
|
||||
}, shallowEqual)
|
||||
|
||||
const [teamWishes, setTeamWishes] = useState(wishesForm?.teamWishes.join(",") || "")
|
||||
const [teamWishComment, setTeamWishComment] = useState(wishesForm?.teamWishComment || "")
|
||||
const [teamWishesComment, setTeamWishesComment] = useState(wishesForm?.teamWishesComment || "")
|
||||
|
||||
useEffect(() => {
|
||||
setTeamWishes(wishesForm?.teamWishes.join(",") || "")
|
||||
setTeamWishComment(wishesForm?.teamWishComment || "")
|
||||
setTeamWishesComment(wishesForm?.teamWishesComment || "")
|
||||
}, [wishesForm])
|
||||
|
||||
const onTeamWishesChanged = (e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setTeamWishes(e.target.value)
|
||||
const onTeamWishCommentChanged = (e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setTeamWishComment(e.target.value)
|
||||
const onTeamWishesCommentChanged = (e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setTeamWishesComment(e.target.value)
|
||||
|
||||
const onSubmit = useCallback(
|
||||
(event: React.SyntheticEvent): void => {
|
||||
@@ -51,11 +51,11 @@ const HomePage: FC<Props> = (): JSX.Element => {
|
||||
fetchVolunteerTeamWishesSet(jwtToken, 0, {
|
||||
id: wishesForm.id,
|
||||
teamWishes: (teamWishes || "").split(","),
|
||||
teamWishComment,
|
||||
teamWishesComment,
|
||||
})
|
||||
)
|
||||
},
|
||||
[dispatch, jwtToken, wishesForm, teamWishes, teamWishComment]
|
||||
[dispatch, jwtToken, wishesForm, teamWishes, teamWishesComment]
|
||||
)
|
||||
|
||||
if (jwtToken === undefined) return <p>Loading...</p>
|
||||
@@ -73,10 +73,10 @@ const HomePage: FC<Props> = (): JSX.Element => {
|
||||
<br />
|
||||
<input
|
||||
type="text"
|
||||
id="teamWishComment"
|
||||
id="teamWishesComment"
|
||||
required
|
||||
value={teamWishComment}
|
||||
onChange={onTeamWishCommentChanged}
|
||||
value={teamWishesComment}
|
||||
onChange={onTeamWishesCommentChanged}
|
||||
/>
|
||||
<button type="button" onClick={onSubmit}>
|
||||
Envoyer
|
||||
|
Reference in New Issue
Block a user