qaApiHandler saves a record into the `qa_apis` table
(qaProjectId string)
| 452 | |
| 453 | // qaApiHandler saves a record into the `qa_apis` table |
| 454 | func (s *Service) qaApiHandler(qaProjectId string) func(record map[string]interface{}) errors.Error { |
| 455 | return func(record map[string]interface{}) errors.Error { |
| 456 | creatorName, err := getStringField(record, "creator_name", false) |
| 457 | if err != nil { |
| 458 | return err |
| 459 | } |
| 460 | if creatorName != "" { |
| 461 | creatorId, _ := s.createOrUpdateAccount(creatorName, qaProjectId) |
| 462 | if creatorId != "" { |
| 463 | record["creator_id"] = creatorId |
| 464 | } |
| 465 | } |
| 466 | delete(record, "creator_name") |
| 467 | record["qa_project_id"] = qaProjectId |
| 468 | return s.dal.CreateWithMap(&qa.QaApi{}, record) |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | // ImportQaTestCases imports csv file to the table `qa_test_cases` |
| 473 | func (s *Service) ImportQaTestCases(qaProjectId, qaProjectName string, file io.ReadCloser, incremental bool) errors.Error { |
no test coverage detected