Parsa Aghayi 696e36bcc8
Deploy Frontend / deploy (push) Successful in 13s
Let the admin panel upload its own images
Typing a URL into the featured-image box meant the panel could only ever
reference images uploaded by hand, so every content change needed an SFTP
round trip. Image fields now get a uploader that posts straight to the
media endpoint, while the plain URL box stays: plenty of images still live
on another host, and pasting a URL should keep working.

The upload is a Server Action rather than a client fetch because the admin
token lives in an httpOnly cookie. adminUpload cannot reuse adminFetch —
that helper always JSON-stringifies the body and pins a JSON Content-Type,
and a hand-written Content-Type on multipart drops the boundary, which
leaves $_FILES empty and turns every upload into a 422.

The value reaches the existing saveResourceAction through the named text
input, which the uploader writes to; the file input itself is left unnamed
so a 4 MB image is never re-sent inside the save request. Removing an
image only clears the field, because the old URL may already be in use by
another row — deleteMediaAction is the separate, deliberate path.

Server Actions default to a 1 MB body, so next.config.mjs now allows 8 MB.
That is the Next-side half only: PHP's upload_max_filesize and post_max_size
have to be at least as large on the API host or it discards the file before
validation ever runs.

Also adds /feed.xml. The blog had a sitemap but no feed, so it was not
readable in any reader.
2026-10-01 19:00:51 -04:00
2026-06-28 15:45:32 +00:00
2024-11-11 12:44:23 +03:30
2024-11-20 16:38:40 +03:30
2024-11-20 16:38:40 +03:30
2024-09-15 10:08:29 +03:30
2024-11-16 17:07:57 +03:30

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

S
Description
No description provided
Readme
42 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 97.5%
JavaScript 1.5%
CSS 1%