diff --git a/repository/amo/amo.go b/repository/amo/amo.go index a78d4a5..59b7f6c 100644 --- a/repository/amo/amo.go +++ b/repository/amo/amo.go @@ -519,6 +519,10 @@ func (r *AmoRepository) GetFieldsWithPagination(ctx context.Context, req *model. v := string(row.Entity.([]byte)) entity = model.EntityType(v) + var fieldType model.FieldType + f := string(row.Type.([]byte)) + fieldType = model.FieldType(f) + field := model.Field{ ID: row.ID, Amoid: row.Amoid, @@ -526,7 +530,7 @@ func (r *AmoRepository) GetFieldsWithPagination(ctx context.Context, req *model. Accountid: row.Accountid, Name: row.Name, Entity: entity, - Type: row.Type, + Type: fieldType, Createdat: row.Createdat.Time.Unix(), } @@ -562,12 +566,17 @@ func (r *AmoRepository) CheckFields(ctx context.Context, fields []model.Field, t var entity model.EntityType v := string(row.Entity.([]byte)) entity = model.EntityType(v) + + var fieldType model.FieldType + f := string(row.Type.([]byte)) + fieldType = model.FieldType(f) + to := model.Field{ Amoid: row.Amoid, Code: row.Code, Accountid: row.Amoid_2, Entity: entity, - Type: row.Type, + Type: fieldType, } toUpdate = append(toUpdate, to) }