posting a form to my golang backend where the birthdate value is null gives me that error above. the field is of type *time.Time. I also check if the value is nil...
var birthdatePtr *time.Time
if req.Birthdate != nil {
birthdateUTC := req.Birthdate.UTC()
birthdatePtr = &birthdateUTC
}
employee := models.Employee{
UserId: createdUser.Id,
Email: req.Email,
Firstname: req.Firstname,
Lastname: req.Lastname,
Birthdate: birthdatePtr,
Phone: req.Phone,
IsActive: req.IsActive,
IsDeleted: false,
EmpTypeId: req.EmployeeTypeId,
CompanyId: companyId,
}
createdEmployee, err := s.employeeRepo.CreateEmployee(tx, &employee)```
how can i make it possible that the client sends an null birthdate to the backend? if i enter a date in the form, it works