test
This commit is contained in:
parent
07644bfbf0
commit
ce2d4fedb9
@ -300,14 +300,14 @@ func (r *AmoRepository) GetPipelinesWithPagination(ctx context.Context, req *mod
|
||||
}
|
||||
|
||||
func (r *AmoRepository) CheckPipelines(ctx context.Context, pipelines []model.Pipeline) error {
|
||||
dollar1, err := json.Marshal(pipelines)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = r.queries.CheckPipelines(ctx, dollar1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//dollar1, err := json.Marshal(pipelines)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//_, err = r.queries.CheckPipelines(ctx, dollar1)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -356,15 +356,15 @@ func (r *AmoRepository) UpdateListSteps(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (r *AmoRepository) CheckSteps(ctx context.Context, steps []model.Step) error {
|
||||
dollar1, err := json.Marshal(steps)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = r.queries.CheckSteps(ctx, dollar1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//dollar1, err := json.Marshal(steps)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//
|
||||
//_, err = r.queries.CheckSteps(ctx, dollar1)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -425,11 +425,43 @@ func (r *AmoRepository) CheckTags(ctx context.Context, tags []model.Tag, tokenID
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = r.queries.CheckTags(ctx, sqlcgen.CheckTagsParams{
|
||||
rows, err := r.queries.CheckTags(ctx, sqlcgen.CheckTagsParams{
|
||||
Accountid: tokenID,
|
||||
Column2: column2,
|
||||
})
|
||||
|
||||
if rows != nil {
|
||||
var toUpdate []model.Tag
|
||||
for _, row := range rows {
|
||||
var entity model.EntityType
|
||||
if v, ok := row.Entity.(string); ok {
|
||||
entity = model.EntityType(v)
|
||||
} else {
|
||||
fmt.Println("unexpected type for EntityType:", row.Entity)
|
||||
}
|
||||
to := model.Tag{
|
||||
ID: row.ID,
|
||||
Amoid: row.Amoid,
|
||||
Accountid: row.Accountid,
|
||||
Entity: entity,
|
||||
Name: row.Name,
|
||||
Color: &row.Color,
|
||||
Createdat: row.Createdat.Time.Unix(),
|
||||
}
|
||||
toUpdate = append(toUpdate, to)
|
||||
}
|
||||
|
||||
dollar1, err := json.Marshal(toUpdate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = r.queries.UpdateTags(ctx, dollar1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -490,19 +522,19 @@ func (r *AmoRepository) UpdateListCustom(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (r *AmoRepository) CheckFields(ctx context.Context, fields []model.Field, tokenID string) error {
|
||||
column2, err := json.Marshal(fields)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = r.queries.CheckFields(ctx, sqlcgen.CheckFieldsParams{
|
||||
Accountid: tokenID,
|
||||
Column2: column2,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//column2, err := json.Marshal(fields)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
//
|
||||
//_, err = r.queries.CheckFields(ctx, sqlcgen.CheckFieldsParams{
|
||||
// Accountid: tokenID,
|
||||
// Column2: column2,
|
||||
//})
|
||||
//
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user