@@ -337,13 +337,13 @@ func (ut *UtApi) requestUploadthing(pathname string, body *bytes.Buffer) (*http.
337
337
}
338
338
339
339
// Delete files from uploadthing.
340
- func (ut * UtApi ) DeleteFiles (ids []string ) (* DeleteFileResponse , error ) {
341
- payload := fileKeysPayload {FileKeys : ids }
342
- idsJson , err := json .Marshal (payload )
340
+ func (ut * UtApi ) DeleteFiles (fileKeys []string ) (* DeleteFileResponse , error ) {
341
+ payload := fileKeysPayload {FileKeys : fileKeys }
342
+ fileKeysJson , err := json .Marshal (payload )
343
343
if err != nil {
344
344
return nil , err
345
345
}
346
- body := bytes .NewBuffer (idsJson )
346
+ body := bytes .NewBuffer (fileKeysJson )
347
347
utResponse , err := ut .requestUploadthing ("/api/deleteFile" , body )
348
348
if err != nil {
349
349
return nil , err
@@ -358,13 +358,12 @@ 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 )
363
- idsJson , err := json .Marshal (payload )
361
+ fileKeysJson , err := json .Marshal (payload )
364
362
if err != nil {
365
363
return nil , err
366
364
}
367
- body := bytes .NewBuffer (idsJson )
365
+ body := bytes .NewBuffer (fileKeysJson )
366
+ fmt .Println (body )
368
367
utResponse , err := ut .requestUploadthing ("/api/getFileUrl" , body )
369
368
if err != nil {
370
369
return nil , err
0 commit comments