Skip to content

Can't delete file #28

Open
Open
@ahmadfaizk

Description

@ahmadfaizk

Bug report

Describe the bug

Got error "body must be object" when delete file

To Reproduce

Got error when remove file, the error is "body must be object", after i debug when call api to remove object got this response,
{"statusCode":"400","error":"Error","message":"body must be object"}
This is my code

type SupabaseStorage struct {
	client     *storage_go.Client
	bucketName string
}

func NewStorage(conf *config.Config) storage.Storage {
	storageUrl := fmt.Sprintf("%s/storage/v1", conf.Supabase.Url)
	client := storage_go.NewClient(storageUrl, conf.Supabase.Key, nil)

	return &SupabaseStorage{
		client:     client,
		bucketName: conf.Supabase.Bucket,
	}
}

func (s *SupabaseStorage) Delete(filename string) error {
	_, err := s.client.RemoveFile(s.bucketName, []string{filename})
	if err != nil {
		return err
	}
	return nil
}

Expected behavior

Successfully delete file

System information

  • Version of supabase-go: v0.7.0
  • Version of Golang: 1.22

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions