Skip to content

write-api: implement POST /api/people/:slug/avatar (multipart attachment + image resize) #32

@themightychris

Description

@themightychris

Deferred from write-api (PR #29). The plan listed POST /api/people/:slug/avatar under People mutations but didn't ship it — multipart attachment handling needs server-side image processing + gitsheets setAttachment plumbing that wasn't in scope.

Per specs/api/people.md: max 5 MB, jpeg/png/webp, store at people/<slug>/avatar.jpg, with a 128×128 thumbnail.

Required pieces:

  • @fastify/multipart plugin (or equivalent) in the API skeleton
  • Image-resize pipeline (sharp or similar) — size-cap 5MB, transcode to jpeg, write a 128×128 thumbnail
  • tx.public.openSheet('people').setAttachment(person, 'avatar.jpg', buffer) per gitsheets API
  • Auth: requireAuth('self | staff')
  • The Person.avatarKey field gets set to the attachment key on commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions