feat: add FAQ uncovered workflow
This commit is contained in:
@@ -152,9 +152,15 @@ type tokenResp struct {
|
||||
ExpireIn int64 `json:"expireIn"`
|
||||
}
|
||||
|
||||
// InsertRecord sends a single row to the DingTalk Notable v1 base.
|
||||
// It returns the record ID on success.
|
||||
// InsertRecord sends a single question-table row to DingTalk Notable v1.
|
||||
// It remains the compatibility entry point for the existing question-table dispatcher.
|
||||
func (c *Client) InsertRecord(ctx context.Context, row Row) (string, error) {
|
||||
return c.InsertFields(ctx, row.ToFields())
|
||||
}
|
||||
|
||||
// InsertFields sends one already-typed field map to DingTalk Notable v1 and
|
||||
// returns the record ID. It is shared by other reviewed Notable table schemas.
|
||||
func (c *Client) InsertFields(ctx context.Context, fields map[string]interface{}) (string, error) {
|
||||
token, err := c.getAccessToken(ctx)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("questiontable token: %w", err)
|
||||
@@ -164,7 +170,6 @@ func (c *Client) InsertRecord(ctx context.Context, row Row) (string, error) {
|
||||
url.PathEscape(c.baseID), url.PathEscape(c.sheetID))
|
||||
reqURL := c.baseURL + path + "?operatorId=" + url.QueryEscape(c.operatorID)
|
||||
|
||||
fields := row.ToFields()
|
||||
body := insertRecordReq{Records: []insertRecord{{Fields: fields}}}
|
||||
jsonBody, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user