diff --git a/backend/db/avatars.go b/backend/db/avatars.go index 27e41e7..6d32394 100644 --- a/backend/db/avatars.go +++ b/backend/db/avatars.go @@ -111,7 +111,7 @@ func (db *DB) WriteMemberAvatar(ctx context.Context, } hash = hex.EncodeToString(hasher.Sum(nil)) - _, err = db.minio.PutObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".webp", webp, -1, minio.PutObjectOptions{ + _, err = db.minio.PutObject(ctx, db.minioBucket, "members/"+memberID.String()+"/"+hash+".webp", webp, -1, minio.PutObjectOptions{ ContentType: "image/webp", SendContentMd5: true, }) @@ -119,7 +119,7 @@ func (db *DB) WriteMemberAvatar(ctx context.Context, return "", errors.Wrap(err, "uploading webp avatar") } - _, err = db.minio.PutObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".jpg", jpeg, -1, minio.PutObjectOptions{ + _, err = db.minio.PutObject(ctx, db.minioBucket, "members/"+memberID.String()+"/"+hash+".jpg", jpeg, -1, minio.PutObjectOptions{ ContentType: "image/jpeg", SendContentMd5: true, }) @@ -131,12 +131,12 @@ func (db *DB) WriteMemberAvatar(ctx context.Context, } func (db *DB) DeleteUserAvatar(ctx context.Context, userID xid.ID, hash string) error { - err := db.minio.RemoveObject(ctx, db.minioBucket, "/users/"+userID.String()+"/"+hash+".webp", minio.RemoveObjectOptions{}) + err := db.minio.RemoveObject(ctx, db.minioBucket, "users/"+userID.String()+"/"+hash+".webp", minio.RemoveObjectOptions{}) if err != nil { return errors.Wrap(err, "deleting webp avatar") } - err = db.minio.RemoveObject(ctx, db.minioBucket, "/users/"+userID.String()+"/"+hash+".jpg", minio.RemoveObjectOptions{}) + err = db.minio.RemoveObject(ctx, db.minioBucket, "users/"+userID.String()+"/"+hash+".jpg", minio.RemoveObjectOptions{}) if err != nil { return errors.Wrap(err, "deleting jpeg avatar") } @@ -145,12 +145,12 @@ func (db *DB) DeleteUserAvatar(ctx context.Context, userID xid.ID, hash string) } func (db *DB) DeleteMemberAvatar(ctx context.Context, memberID xid.ID, hash string) error { - err := db.minio.RemoveObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".webp", minio.RemoveObjectOptions{}) + err := db.minio.RemoveObject(ctx, db.minioBucket, "members/"+memberID.String()+"/"+hash+".webp", minio.RemoveObjectOptions{}) if err != nil { return errors.Wrap(err, "deleting webp avatar") } - err = db.minio.RemoveObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".jpg", minio.RemoveObjectOptions{}) + err = db.minio.RemoveObject(ctx, db.minioBucket, "members/"+memberID.String()+"/"+hash+".jpg", minio.RemoveObjectOptions{}) if err != nil { return errors.Wrap(err, "deleting jpeg avatar") } @@ -159,7 +159,7 @@ func (db *DB) DeleteMemberAvatar(ctx context.Context, memberID xid.ID, hash stri } func (db *DB) UserAvatar(ctx context.Context, userID xid.ID, hash string) (io.ReadCloser, error) { - obj, err := db.minio.GetObject(ctx, db.minioBucket, "/users/"+userID.String()+"/"+hash+".webp", minio.GetObjectOptions{}) + obj, err := db.minio.GetObject(ctx, db.minioBucket, "users/"+userID.String()+"/"+hash+".webp", minio.GetObjectOptions{}) if err != nil { return nil, errors.Wrap(err, "getting object") } @@ -167,7 +167,7 @@ func (db *DB) UserAvatar(ctx context.Context, userID xid.ID, hash string) (io.Re } func (db *DB) MemberAvatar(ctx context.Context, memberID xid.ID, hash string) (io.ReadCloser, error) { - obj, err := db.minio.GetObject(ctx, db.minioBucket, "/members/"+memberID.String()+"/"+hash+".webp", minio.GetObjectOptions{}) + obj, err := db.minio.GetObject(ctx, db.minioBucket, "members/"+memberID.String()+"/"+hash+".webp", minio.GetObjectOptions{}) if err != nil { return nil, errors.Wrap(err, "getting object") } diff --git a/backend/db/export.go b/backend/db/export.go index 7741a8d..6141aac 100644 --- a/backend/db/export.go +++ b/backend/db/export.go @@ -20,7 +20,7 @@ type DataExport struct { } func (de DataExport) Path() string { - return "/exports/" + de.UserID.String() + "/" + de.Filename + ".zip" + return "exports/" + de.UserID.String() + "/" + de.Filename + ".zip" } const ErrNoExport = errors.Sentinel("no data export exists") diff --git a/frontend/src/routes/settings/export/+page.svelte b/frontend/src/routes/settings/export/+page.svelte index 983dcce..31f87e7 100644 --- a/frontend/src/routes/settings/export/+page.svelte +++ b/frontend/src/routes/settings/export/+page.svelte @@ -69,7 +69,7 @@ Download your export file below:
-