From 07bf63c8dfe5e7a41a3bcd6ac22517ec7c7d49b0 Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 28 Apr 2024 16:09:35 +0300 Subject: [PATCH] update amo repo --- repository/amo/amo.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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) }