feat(kol): repo support for cross-tenant revision lookup
This commit is contained in:
@@ -48,19 +48,25 @@ func (q *Queries) CountArticles(ctx context.Context, arg CountArticlesParams) (i
|
||||
}
|
||||
|
||||
const createArticle = `-- name: CreateArticle :one
|
||||
INSERT INTO articles (tenant_id, source_type, template_id, generate_status, publish_status)
|
||||
VALUES ($1, $2, $3, 'pending', 'unpublished')
|
||||
INSERT INTO articles (tenant_id, source_type, template_id, kol_prompt_id, generate_status, publish_status)
|
||||
VALUES ($1, $2, $3, $4, 'pending', 'unpublished')
|
||||
RETURNING id
|
||||
`
|
||||
|
||||
type CreateArticleParams struct {
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
SourceType string `json:"source_type"`
|
||||
TemplateID pgtype.Int8 `json:"template_id"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
SourceType string `json:"source_type"`
|
||||
TemplateID pgtype.Int8 `json:"template_id"`
|
||||
KolPromptID pgtype.Int8 `json:"kol_prompt_id"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateArticle(ctx context.Context, arg CreateArticleParams) (int64, error) {
|
||||
row := q.db.QueryRow(ctx, createArticle, arg.TenantID, arg.SourceType, arg.TemplateID)
|
||||
row := q.db.QueryRow(ctx, createArticle,
|
||||
arg.TenantID,
|
||||
arg.SourceType,
|
||||
arg.TemplateID,
|
||||
arg.KolPromptID,
|
||||
)
|
||||
var id int64
|
||||
err := row.Scan(&id)
|
||||
return id, err
|
||||
|
||||
Reference in New Issue
Block a user