Skip to content

Org settings: upload and remove the organization logo - #35

Merged
isTravis merged 1 commit into
mainfrom
worktree-org-avatar-upload
Oct 2, 2026
Merged

isTravis merged 1 commit into
mainfrom
worktree-org-avatar-upload

Conversation

@tefkah

@tefkah tefkah commented Oct 2, 2026

Copy link
Copy Markdown
Member

The org avatar endpoint (POST /api/accounts/:slug/avatar) already existed, but nothing in the UI used it. This adds the missing pieces.

  • Org settings: owners get a file picker, an "Upload logo" button and a "Remove" button. JPEG, PNG, GIF or WebP up to 5 MB, as the endpoint already enforces.
  • New DELETE /api/accounts/:slug/avatar (owners only): clears avatar_url and deletes the stored files.
  • Old files are deleted on upload: uploading a new logo removes the previous file under avatars/<orgId>/. The account-delete and org-delete routes now share the same cleanup helper.
  • Personal Settings: removed the "Upload avatar" form. It posted to /api/accounts/me/avatar, which matched /:slug/avatar with slug me and always returned "Organization not found". The personal picture comes from KF Auth anyway, so the page now says "Picture managed by your KF Account".

Before merging

Production doesn't set ASSETS_BASE_URL, so logo URLs default to https://assets.underlay.org, which probably doesn't serve S3_PUBLIC_BUCKET publicly. If so, uploads succeed but the images show as broken. One of these needs to happen first:

  • set ASSETS_BASE_URL to the bucket's public URL, or
  • make that domain public, or
  • serve avatars through the app.

Testing

Typecheck, lint, format check and unit tests (177) pass. I didn't try an upload against a running app with a real bucket.

@tefkah
tefkah requested a review from isTravis October 2, 2026 15:15
@tefkah

tefkah commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

wasnt possible to upload avatars for orgs (I created https://www.underlay.org/centeroftrialanderror/ today, hence)

also uploading avatars for your own account did nothing, bc it would try to upload to the /me organization

@isTravis

isTravis commented Oct 2, 2026

Copy link
Copy Markdown
Member

Awesome. It's Before Merging note isn't accurate - the buckets/domains are as they should be, this can merge as is.

@isTravis
isTravis merged commit b9efa9e into main Oct 2, 2026
1 check passed
@isTravis
isTravis deleted the worktree-org-avatar-upload branch October 2, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants