lab-64 / split-the-bill-server

Backend for the Split the Bill App
4 stars 0 forks source link

Delete old images from Google Storage #183

Closed f-odc closed 1 month ago

f-odc commented 4 months ago

If an user updates the profile image, a new image will get uploaded to Google Storage. The old image has to be deleted.

Some code impression:

ctx := context.Background()
// Create a handle to the object
    obj := client.Bucket(bucketName).Object(objectName)
// Delete the object
if err := obj.Delete(ctx); err != nil {
    return fmt.Errorf("failed to delete object: %v", err)
}