feat: edit post images (upload/remove) + fix captcha input in dark mode

- PostDetail edit modal: show existing images with delete button, upload
  new images (multi-file, 5MB limit), save replaces image list
- API PUT /posts/:id accepts images array; omitting keeps original
- lib/api updatePost passes images
- NewPost/ReplyList captcha answer input: use CSS vars (was hardcoded
  #e2e8f0 border with white bg — glaring in dark mode)
This commit is contained in:
lezi-fun committed 2026-08-10 17:41:46 +08:00
1 parent ebc5201569
commit 4a30e79269
5 files changed
+60 -12

No files matched your search

+2 -2
View File
@@ -57,8 +57,8 @@ export const API = {
createPost(title, content, images) {
return apiFetch('/posts', { method: 'POST', body: JSON.stringify({ title, content, images: images || [] }) });
},
updatePost(postId, title, content) {
return apiFetch('/posts/' + postId, { method: 'PUT', body: JSON.stringify({ title, content }) });
updatePost(postId, title, content, images) {
return apiFetch('/posts/' + postId, { method: 'PUT', body: JSON.stringify({ title, content, images }) });
},
togglePinPost(postId) {
return apiFetch('/posts/' + postId + '/pin', { method: 'PUT' });