Skip to content

Commit

Permalink
skip validation for company name and date founded questions in the ba…
Browse files Browse the repository at this point in the history
…ckend
  • Loading branch information
juancwu committed Feb 4, 2025
1 parent a2986e2 commit b0edd47
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backend/internal/v1/v1_projects/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,15 @@ func (h *Handler) handleSubmitProject(c echo.Context) error {
var validationErrors []ValidationError

// Validate each question
for _, question := range questions {
for i, question := range questions {
// First two questions are the company name and date founded which are never filled
// by the user since they can't change through project form.
switch i {
case 0:
question.Answer = company.Name
case 1:
question.Answer = time.Unix(company.DateFounded, 0).Format("2006-01-02")
}
// Check if required question is answered
if question.Required {
switch question.InputType {
Expand Down

0 comments on commit b0edd47

Please sign in to comment.