agnai
agnai copied to clipboard
Feat: Remove an avatar
This was... harder than I thought.
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.