upd query UpdateGigaChatQuizFlag
This commit is contained in:
parent
fe76dc7ca7
commit
25f65a58f1
@ -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;
|
||||
|
||||
-- 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
|
||||
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
|
||||
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 {
|
||||
ID int64 `db:"id" json:"id"`
|
||||
Accountid string `db:"accountid" json:"accountid"`
|
||||
Gigachat bool `db:"gigachat" json:"gigachat"`
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -743,10 +743,11 @@ func (r *QuizRepository) CheckQuizOwner(ctx context.Context, accountID string, q
|
||||
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{
|
||||
ID: quizID,
|
||||
Accountid: accountID,
|
||||
Gigachat: flag,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user