Set call transcript
This commit is contained in:
parent
c79bfc0fde
commit
d7352ddb53
3 changed files with 6 additions and 7 deletions
|
@ -84,16 +84,16 @@ func (q *Queries) AddCall(ctx context.Context, arg AddCallParams) (Call, error)
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateCallTranscript = `-- name: UpdateCallTranscript :exec
|
const setCallTranscript = `-- name: SetCallTranscript :exec
|
||||||
UPDATE calls SET transcript = $2 WHERE id = $1
|
UPDATE calls SET transcript = $2 WHERE id = $1
|
||||||
`
|
`
|
||||||
|
|
||||||
type UpdateCallTranscriptParams struct {
|
type SetCallTranscriptParams struct {
|
||||||
ID pgtype.UUID
|
ID pgtype.UUID
|
||||||
Transcript pgtype.Text
|
Transcript pgtype.Text
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) UpdateCallTranscript(ctx context.Context, arg UpdateCallTranscriptParams) error {
|
func (q *Queries) SetCallTranscript(ctx context.Context, arg SetCallTranscriptParams) error {
|
||||||
_, err := q.db.Exec(ctx, updateCallTranscript, arg.ID, arg.Transcript)
|
_, err := q.db.Exec(ctx, setCallTranscript, arg.ID, arg.Transcript)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,8 +73,7 @@ func (q *Queries) GetTalkgroupsWithAnyTags(ctx context.Context, tags []string) (
|
||||||
|
|
||||||
const setTalkgroupTags = `-- name: SetTalkgroupTags :exec
|
const setTalkgroupTags = `-- name: SetTalkgroupTags :exec
|
||||||
INSERT INTO talkgroups_tags(talkgroup_id, tags) VALUES($1, $2)
|
INSERT INTO talkgroups_tags(talkgroup_id, tags) VALUES($1, $2)
|
||||||
ON CONFLICT (talkgroup_id) DO UPDATE
|
ON CONFLICT (talkgroup_id) DO UPDATE SET tags = $2
|
||||||
SET tags = $2
|
|
||||||
`
|
`
|
||||||
|
|
||||||
type SetTalkgroupTagsParams struct {
|
type SetTalkgroupTagsParams struct {
|
||||||
|
|
|
@ -17,5 +17,5 @@ INSERT INTO calls (
|
||||||
) VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
|
) VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
|
||||||
RETURNING *;
|
RETURNING *;
|
||||||
|
|
||||||
-- name: UpdateCallTranscript :exec
|
-- name: SetCallTranscript :exec
|
||||||
UPDATE calls SET transcript = $2 WHERE id = $1;
|
UPDATE calls SET transcript = $2 WHERE id = $1;
|
||||||
|
|
Loading…
Reference in a new issue