0👍
✅
You could play around with substrings to get/set the first 4 chars for year, 2 for month and 2 for days of the birthDate string.
But if it was me, I would keep the year, month and day separate in the store and combine when calling the api:
axios.post(‘http://??.???.???.???:????/api/signup’, {
…state.Userinfo,
birthDate: `${state.birthYear}${state.birthMonth}${state.birthDay}`,
});
Source:stackexchange.com