diff --git a/dal/db_query/queries.sql b/dal/db_query/queries.sql index 9d262ee..6894962 100644 --- a/dal/db_query/queries.sql +++ b/dal/db_query/queries.sql @@ -709,7 +709,7 @@ SELECT (new_tags->>'AmoID')::INT, new_tags->>'Name', new_tags->>'Color', CURRENT_TIMESTAMP -FROM json_array_elements($2::json[]) AS new_tags +FROM json_array_elements($2::json) AS new_tags JOIN user_data ON true ON CONFLICT (amoID, accountID, entity) DO UPDATE SET name = EXCLUDED.name, @@ -724,7 +724,7 @@ SELECT (new_pipelines->>'AmoID')::INT, new_pipelines->>'Name', new_pipelines->>'IsArchive', CURRENT_TIMESTAMP -FROM json_array_elements($1::json[]) AS new_pipelines +FROM json_array_elements($1::json) AS new_pipelines ON CONFLICT (amoID, accountID) DO UPDATE SET name = EXCLUDED.name, isArchive = EXCLUDED.isArchive, @@ -739,7 +739,7 @@ SELECT (new_steps->>'AmoID')::INT, new_steps->>'Name', new_steps->>'Color', CURRENT_TIMESTAMP -FROM json_array_elements($1::json[]) AS new_steps +FROM json_array_elements($1::json) AS new_steps ON CONFLICT (amoID, accountID, PipelineID) DO UPDATE SET name = EXCLUDED.name, color = EXCLUDED.color, @@ -760,7 +760,7 @@ SELECT (new_fields->>'AmoID')::INT, CAST(new_fields->>'Entity' AS entitytype), new_fields->>'Type', CURRENT_TIMESTAMP -FROM json_array_elements($2::json[]) AS new_fields +FROM json_array_elements($2::json) AS new_fields JOIN user_data ON true ON CONFLICT (amoID, accountID, entity) DO UPDATE SET name = EXCLUDED.name, diff --git a/repository/amo/amo.go b/repository/amo/amo.go index cc55cd2..8bb936f 100644 --- a/repository/amo/amo.go +++ b/repository/amo/amo.go @@ -316,18 +316,6 @@ func (r *AmoRepository) CheckPipelines(ctx context.Context, pipelines []model.Pi return nil } -func (r *AmoRepository) GetPipelineByID(ctx context.Context, accountID string, amoid int) (*model.Pipeline, error) { - return nil, nil -} - -func (r *AmoRepository) UpdatePipeline(ctx context.Context, pipeline *model.Pipeline) error { - return nil -} - -func (r *AmoRepository) InsertPipeline(ctx context.Context, pipeline *model.Pipeline) error { - return nil -} - // методы steps func (r *AmoRepository) GetStepsWithPagination(ctx context.Context, req *model.PaginationReq) (*model.UserListStepsResp, error) { @@ -388,18 +376,6 @@ func (r *AmoRepository) CheckSteps(ctx context.Context, steps []model.Step) erro return nil } -func (r *AmoRepository) GetStepByID(ctx context.Context, accountID string, amoid int) (*model.Step, error) { - return nil, nil -} - -func (r *AmoRepository) UpdateStep(ctx context.Context, step *model.Step) error { - return nil -} - -func (r *AmoRepository) InsertStep(ctx context.Context, step *model.Step) error { - return nil -} - // методы tags func (r *AmoRepository) GetTagsWithPagination(ctx context.Context, req *model.PaginationReq) (*model.UserListTagsResp, error) { @@ -471,18 +447,6 @@ func (r *AmoRepository) CheckTags(ctx context.Context, tags []model.Tag, tokenID return nil } -func (r *AmoRepository) GetTagByID(ctx context.Context, accountID string, amoid int, entity model.EntityType) (*model.Tag, error) { - return nil, nil -} - -func (r *AmoRepository) UpdateTag(ctx context.Context, tag *model.Tag) error { - return nil -} - -func (r *AmoRepository) InsertTag(ctx context.Context, tag *model.Tag) error { - return nil -} - // методы fields func (r *AmoRepository) GetFieldsWithPagination(ctx context.Context, req *model.PaginationReq) (*model.UserListFieldsResp, error) { @@ -557,18 +521,6 @@ func (r *AmoRepository) CheckFields(ctx context.Context, fields []model.Field, t return nil } -func (r *AmoRepository) GetFieldByID(ctx context.Context, accountID string, amoid int, entity model.EntityType) (*model.Field, error) { - return nil, nil -} - -func (r *AmoRepository) UpdateField(ctx context.Context, field *model.Field) error { - return nil -} - -func (r *AmoRepository) InsertField(ctx context.Context, field *model.Field) error { - return nil -} - // методы rules func (r *AmoRepository) ChangeQuizSettings(ctx context.Context, request *model.RulesReq) error {