refactor(payload): extract ai extensions to @mintel/payload-ai package
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Failing after 1m24s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Failing after 1m24s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { CollectionConfig } from "payload";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { replicateMediaHandler } from "@mintel/payload-ai";
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
@@ -14,6 +15,13 @@ export const Media: CollectionConfig = {
|
||||
access: {
|
||||
read: () => true, // Publicly readable
|
||||
},
|
||||
endpoints: [
|
||||
{
|
||||
path: "/:id/ai-process",
|
||||
method: "post",
|
||||
handler: replicateMediaHandler as any,
|
||||
},
|
||||
],
|
||||
upload: {
|
||||
staticDir: path.resolve(dirname, "../../../../public/media"),
|
||||
adminThumbnail: "thumbnail",
|
||||
@@ -39,6 +47,15 @@ export const Media: CollectionConfig = {
|
||||
],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: "aiProcessButtons",
|
||||
type: "ui",
|
||||
admin: {
|
||||
components: {
|
||||
Field: "@mintel/payload-ai/components/AiMediaButtons#AiMediaButtons",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "alt",
|
||||
type: "text",
|
||||
|
||||
Reference in New Issue
Block a user