MCPcopy Index your code
hub / github.com/apache/devlake / qaApiHandler

Method qaApiHandler

backend/plugins/customize/service/service.go:454–470  ·  view source on GitHub ↗

qaApiHandler saves a record into the `qa_apis` table

(qaProjectId string)

Source from the content-addressed store, hash-verified

452
453// qaApiHandler saves a record into the `qa_apis` table
454func (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`
473func (s *Service) ImportQaTestCases(qaProjectId, qaProjectName string, file io.ReadCloser, incremental bool) errors.Error {

Callers 1

ImportQaApisMethod · 0.95

Calls 3

createOrUpdateAccountMethod · 0.95
getStringFieldFunction · 0.70
CreateWithMapMethod · 0.65

Tested by

no test coverage detected