@@ -151,7 +151,7 @@ type UploadthingUrl struct {
151
151
152
152
// Represents a full response struct for a list of urls
153
153
type UploadthingUrlsResponse struct {
154
- Urls []UploadthingUrl `json:"urls "`
154
+ Data []UploadthingUrl `json:"data "`
155
155
}
156
156
157
157
func parseUploadthingUrlsResponse (resp * http.Response ) (UploadthingUrlsResponse , error ) {
@@ -328,9 +328,9 @@ func (ut *UtApi) requestUploadthing(pathname string, body *bytes.Buffer) (*http.
328
328
resp_body := bytes .NewBuffer ([]byte {})
329
329
_ , err := io .Copy (resp_body , resp .Body )
330
330
if err != nil {
331
- return nil , fmt .Errorf ("failed to delete files , status code: %d, body: %s, req: %s" , resp .StatusCode , resp_body , getDebugMessage (url , headers , body ))
331
+ return nil , fmt .Errorf ("uploadthing request failed , status code: %d, body: %s, req: %s" , resp .StatusCode , resp_body , getDebugMessage (url , headers , body ))
332
332
} else {
333
- return nil , fmt .Errorf ("failed to delete files , status code: %d, req: %s" , resp .StatusCode , getDebugMessage (url , headers , body ))
333
+ return nil , fmt .Errorf ("uploadthing request failed , status code: %d, req: %s" , resp .StatusCode , getDebugMessage (url , headers , body ))
334
334
}
335
335
}
336
336
return resp , nil
@@ -358,6 +358,8 @@ func (ut *UtApi) DeleteFiles(ids []string) (*DeleteFileResponse, error) {
358
358
// Given an array of file keys, get the corresponding urls.
359
359
func (ut * UtApi ) GetFileUrls (fileKeys []string ) (* UploadthingUrlsResponse , error ) {
360
360
payload := fileKeysPayload {FileKeys : fileKeys }
361
+ fmt .Println ("payload" )
362
+ fmt .Println (payload )
361
363
idsJson , err := json .Marshal (payload )
362
364
if err != nil {
363
365
return nil , err
0 commit comments