I've been trying to update a single file within a folder in the bucket that i created but when i go to update with a new image from the front does not update the image and gives the following error.
statusCode: "404", error: "Not found"
Then when i went to check the route of the call it seems to be wrong http://localhost:54321/storage/v1/object/xxx-images/xxx_image/36a75358-8612-4e0e-96d8-76e4f579b80d.jpg
. So after checked the route i went to the bucket and copy the route from the image uploaded and the route is different from the route of the call previously mentioned http://localhost:54321/storage/v1/object/public/xxx-images/xxx_image/05f9d208-bab2-45ab-a355-71ba4a41cf59.jpg
.
As you can see the route from the image saved on the bucket has the /public/
word on the route. I took the api call to update from the documentation docs and the api call on the front that i have made is the following:
const { data, error } = await supabase
.storage
.from('xxx-images')
.update(`xxx_image/${oldPresentationImage}`, presentationImage.file, {
contentType: 'image/png'
});
if(error) {console.log('error ', error)};
I don't get why the route is not the same when i call the api update method from the front. I'm using the version 1.1.0
and i got the policies for authenticated users