Merge branch 'stepsRef' into 'main'
Steps ref See merge request backend/quiz/common!16
This commit is contained in:
commit
31f9f421fc
@ -732,7 +732,7 @@ ORDER BY t.ID OFFSET ($2 - 1) * $3 LIMIT $3;
|
||||
-- name: GetStepsWithPagination :many
|
||||
SELECT s.*, COUNT(*) OVER() as total_count
|
||||
FROM steps s JOIN (SELECT AmoID FROM users WHERE users.AccountID = $1) u ON s.AccountID = u.AmoID
|
||||
WHERE s.Deleted = false
|
||||
WHERE s.Deleted = false AND PipelineID = $4
|
||||
ORDER BY s.ID OFFSET ($2 - 1) * $3 LIMIT $3;
|
||||
|
||||
-- name: GetPipelinesWithPagination :many
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.25.0
|
||||
// sqlc v1.26.0
|
||||
|
||||
package sqlcgen
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.25.0
|
||||
// sqlc v1.26.0
|
||||
|
||||
package sqlcgen
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.25.0
|
||||
// sqlc v1.26.0
|
||||
// source: queries.sql
|
||||
|
||||
package sqlcgen
|
||||
@ -2290,14 +2290,15 @@ func (q *Queries) GetResultAnswers(ctx context.Context, id int64) ([]GetResultAn
|
||||
const getStepsWithPagination = `-- name: GetStepsWithPagination :many
|
||||
SELECT s.id, s.amoid, s.pipelineid, s.accountid, s.name, s.color, s.deleted, s.createdat, COUNT(*) OVER() as total_count
|
||||
FROM steps s JOIN (SELECT AmoID FROM users WHERE users.AccountID = $1) u ON s.AccountID = u.AmoID
|
||||
WHERE s.Deleted = false
|
||||
WHERE s.Deleted = false AND PipelineID = $4
|
||||
ORDER BY s.ID OFFSET ($2 - 1) * $3 LIMIT $3
|
||||
`
|
||||
|
||||
type GetStepsWithPaginationParams struct {
|
||||
Accountid string `db:"accountid" json:"accountid"`
|
||||
Column2 interface{} `db:"column_2" json:"column_2"`
|
||||
Limit int32 `db:"limit" json:"limit"`
|
||||
Accountid string `db:"accountid" json:"accountid"`
|
||||
Column2 interface{} `db:"column_2" json:"column_2"`
|
||||
Limit int32 `db:"limit" json:"limit"`
|
||||
Pipelineid int32 `db:"pipelineid" json:"pipelineid"`
|
||||
}
|
||||
|
||||
type GetStepsWithPaginationRow struct {
|
||||
@ -2313,7 +2314,12 @@ type GetStepsWithPaginationRow struct {
|
||||
}
|
||||
|
||||
func (q *Queries) GetStepsWithPagination(ctx context.Context, arg GetStepsWithPaginationParams) ([]GetStepsWithPaginationRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getStepsWithPagination, arg.Accountid, arg.Column2, arg.Limit)
|
||||
rows, err := q.db.QueryContext(ctx, getStepsWithPagination,
|
||||
arg.Accountid,
|
||||
arg.Column2,
|
||||
arg.Limit,
|
||||
arg.Pipelineid,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -413,11 +413,12 @@ func (r *AmoRepository) GetUserPipelinesByID(ctx context.Context, accountID int3
|
||||
|
||||
// методы steps
|
||||
|
||||
func (r *AmoRepository) GetStepsWithPagination(ctx context.Context, req *model.PaginationReq, accountID string) (*model.UserListStepsResp, error) {
|
||||
func (r *AmoRepository) GetStepsWithPagination(ctx context.Context, req *model.PaginationReq, accountID string, pipelineID int32) (*model.UserListStepsResp, error) {
|
||||
rows, err := r.queries.GetStepsWithPagination(ctx, sqlcgen.GetStepsWithPaginationParams{
|
||||
Accountid: accountID,
|
||||
Column2: req.Page,
|
||||
Limit: req.Size,
|
||||
Accountid: accountID,
|
||||
Column2: req.Page,
|
||||
Limit: req.Size,
|
||||
Pipelineid: pipelineID,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user