update lead target repo methods
This commit is contained in:
parent
da7f303851
commit
567119396b
@ -373,10 +373,15 @@ func (r *AccountRepository) PostLeadTarget(ctx context.Context, req model.LeadTa
|
||||
if err != nil {
|
||||
return model.LeadTarget{}, err
|
||||
}
|
||||
|
||||
var targetType model.LeadTargetType
|
||||
v := string(row.Type.([]byte))
|
||||
targetType = model.LeadTargetType(v)
|
||||
|
||||
return model.LeadTarget{
|
||||
ID: row.ID,
|
||||
AccountID: row.Accountid,
|
||||
Type: row.Type,
|
||||
Type: targetType,
|
||||
QuizID: row.Quizid,
|
||||
Target: row.Target,
|
||||
Deleted: row.Deleted,
|
||||
@ -405,10 +410,14 @@ func (r *AccountRepository) GetLeadTarget(ctx context.Context, accountID string,
|
||||
}
|
||||
var leadTargets []model.LeadTarget
|
||||
for _, row := range rows {
|
||||
var targetType model.LeadTargetType
|
||||
v := string(row.Type.([]byte))
|
||||
targetType = model.LeadTargetType(v)
|
||||
|
||||
leadTargets = append(leadTargets, model.LeadTarget{
|
||||
ID: row.ID,
|
||||
AccountID: row.Accountid,
|
||||
Type: row.Type,
|
||||
Type: targetType,
|
||||
QuizID: row.Quizid,
|
||||
Target: row.Target,
|
||||
Deleted: row.Deleted,
|
||||
@ -430,10 +439,15 @@ func (r *AccountRepository) UpdateLeadTarget(ctx context.Context, req model.Lead
|
||||
}
|
||||
return model.LeadTarget{}, err
|
||||
}
|
||||
|
||||
var targetType model.LeadTargetType
|
||||
v := string(row.Type.([]byte))
|
||||
targetType = model.LeadTargetType(v)
|
||||
|
||||
return model.LeadTarget{
|
||||
ID: row.ID,
|
||||
AccountID: row.Accountid,
|
||||
Type: row.Type,
|
||||
Type: targetType,
|
||||
QuizID: row.Quizid,
|
||||
Target: row.Target,
|
||||
Deleted: row.Deleted,
|
||||
|
Loading…
Reference in New Issue
Block a user