agnai icon indicating copy to clipboard operation
agnai copied to clipboard

Feat: Remove an avatar

Open acidbubbles opened this issue 2 years ago • 0 comments

This was... harder than I thought.

image

When there's an avatar, just show a remove button. When you click remove, you can upload or generate one.

To achieve that though, because the avatar field was used and it's using a multipart post, I had to be creative. I'm posting a clearAvatar item, which is converted to '' in the db call, which is then passed as $unset.

I didn't want to refactor, so that's the best I could find. otherwise, maybe it would be easier to have a separate "ordinary" POST with the character JSON, and separately upload the image from the client, instead of doing that on the server?

For now that should work fine.

acidbubbles avatar May 28 '23 03:05 acidbubbles