feat: 更新FAQ条目时返回更新后的数据

This commit is contained in:
wizardchen
2026-01-07 11:50:57 +08:00
parent b71e7084fd
commit be38966cbe
4 changed files with 45 additions and 22 deletions
+7 -4
View File
@@ -242,15 +242,18 @@ func (c *Client) GetFAQEntry(ctx context.Context,
// UpdateFAQEntry updates a single FAQ entry.
func (c *Client) UpdateFAQEntry(ctx context.Context,
knowledgeBaseID, entryID string, payload *FAQEntryPayload,
) error {
) (*FAQEntry, error) {
path := fmt.Sprintf("/api/v1/knowledge-bases/%s/faq/entries/%s", knowledgeBaseID, entryID)
resp, err := c.doRequest(ctx, http.MethodPut, path, payload, nil)
if err != nil {
return err
return nil, err
}
var response faqSimpleResponse
return parseResponse(resp, &response)
var response FAQEntryResponse
if err := parseResponse(resp, &response); err != nil {
return nil, err
}
return response.Data, nil
}
// UpdateFAQEntryFieldsBatch updates multiple fields for FAQ entries in bulk.