upd query UpdateGigaChatQuizFlag
This commit is contained in:
parent
b191bb2ca0
commit
80573b3444
@ -1465,7 +1465,7 @@ INSERT INTO bitrixContact (AccountID, BitrixID, Field) VALUES ($1, $2, $3) RETUR
|
|||||||
UPDATE bitrixContact SET Field = $1,BitrixID=$3 WHERE ID = $2;
|
UPDATE bitrixContact SET Field = $1,BitrixID=$3 WHERE ID = $2;
|
||||||
|
|
||||||
-- name: UpdateGigaChatQuizFlag :exec
|
-- name: UpdateGigaChatQuizFlag :exec
|
||||||
UPDATE quiz SET gigachat = true where id = $1 AND accountid = $2 AND deleted = false;
|
UPDATE quiz SET gigachat = $3 WHERE id = $1 AND accountid = $2 AND deleted = false;
|
||||||
|
|
||||||
-- name: GetAllQuizUtms :many
|
-- name: GetAllQuizUtms :many
|
||||||
SELECT * from quiz_utm where quizID = $1 and deleted=false;
|
SELECT * from quiz_utm where quizID = $1 and deleted=false;
|
||||||
|
@ -5428,16 +5428,17 @@ func (q *Queries) UpdateFields(ctx context.Context, dollar_1 json.RawMessage) er
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateGigaChatQuizFlag = `-- name: UpdateGigaChatQuizFlag :exec
|
const updateGigaChatQuizFlag = `-- name: UpdateGigaChatQuizFlag :exec
|
||||||
UPDATE quiz SET gigachat = true where id = $1 AND accountid = $2 AND deleted = false
|
UPDATE quiz SET gigachat = $3 WHERE id = $1 AND accountid = $2 AND deleted = false
|
||||||
`
|
`
|
||||||
|
|
||||||
type UpdateGigaChatQuizFlagParams struct {
|
type UpdateGigaChatQuizFlagParams struct {
|
||||||
ID int64 `db:"id" json:"id"`
|
ID int64 `db:"id" json:"id"`
|
||||||
Accountid string `db:"accountid" json:"accountid"`
|
Accountid string `db:"accountid" json:"accountid"`
|
||||||
|
Gigachat bool `db:"gigachat" json:"gigachat"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) UpdateGigaChatQuizFlag(ctx context.Context, arg UpdateGigaChatQuizFlagParams) error {
|
func (q *Queries) UpdateGigaChatQuizFlag(ctx context.Context, arg UpdateGigaChatQuizFlagParams) error {
|
||||||
_, err := q.db.ExecContext(ctx, updateGigaChatQuizFlag, arg.ID, arg.Accountid)
|
_, err := q.db.ExecContext(ctx, updateGigaChatQuizFlag, arg.ID, arg.Accountid, arg.Gigachat)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,10 +756,11 @@ func (r *QuizRepository) CheckQuizOwner(ctx context.Context, accountID string, q
|
|||||||
return id == accountID, nil
|
return id == accountID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *QuizRepository) UpdateGigaChatQuizFlag(ctx context.Context, quizID int64, accountID string) error {
|
func (r *QuizRepository) UpdateGigaChatQuizFlag(ctx context.Context, quizID int64, accountID string, flag bool) error {
|
||||||
err := r.queries.UpdateGigaChatQuizFlag(ctx, sqlcgen.UpdateGigaChatQuizFlagParams{
|
err := r.queries.UpdateGigaChatQuizFlag(ctx, sqlcgen.UpdateGigaChatQuizFlagParams{
|
||||||
ID: quizID,
|
ID: quizID,
|
||||||
Accountid: accountID,
|
Accountid: accountID,
|
||||||
|
Gigachat: flag,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user