Skip to content

fix(admin,core): stop sending and tolerate empty image accent - #2854

Open
poboll wants to merge 1 commit into
masterfrom
fix/write-image-empty-accent
Open

poboll wants to merge 1 commit into
masterfrom
fix/write-image-empty-accent

Conversation

@poboll

@poboll poboll commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • the write page builds images entries for images scraped from the markdown body / cover with a hardcoded accent: '' (WriteRouteViewsContent addImageSrc), and ImageSchema.accent (zHexColor.optional()) rejects the empty string — so the whole save request fails with a schema error (reported as innei-dev/yohaku#160, but both ends live in this repo)
  • addImageSrc now omits accent instead of defaulting to '' (the field stays optional on the model)
  • ImageSchema.accent additionally preprocesses ''/null to undefined, so any other client sending an empty accent no longer fails the entire payload

Notes

  • invalid colors (#zzz) are still rejected — validation is not loosened
  • verified: full tsc --noEmit on apps/admin (0 errors); zod behavior checked against zod 4.4.3 (empty/null pass as undefined, #e095a4 passes, #zzz rejected)
  • the exported openapi.json is byte-identical before/after the schema change, so the OpenAPI check is unaffected

@safedep

safedep Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

View complete scan results →

This report is generated by SafeDep GitHub App

This branch has not been deployed

No deployments
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.

1 participant