Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a s3Url field to directly expose s3 url in Payload API #2

Open
jeanbmar opened this issue Mar 16, 2022 · 0 comments
Open

Add a s3Url field to directly expose s3 url in Payload API #2

jeanbmar opened this issue Mar 16, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeanbmar
Copy link
Owner

In order to reduce overhead for developers, this:

fields: [
    {
      name: 'url',
      type: 'text',
      access: {
        create: () => false,
      },
      admin: {
        disabled: true,
      },
      hooks: {
        afterRead: [
          ({ data: doc }) =>
            `https://my-bucket.s3.eu-west-3.amazonaws.com/images/${doc.type}/${doc.filename}`,
        ],
      },
    },
  ],

will be replaced with this:

s3: {
  // ...
  s3Url: ({ doc }) => `https://my-bucket.s3.eu-west-3.amazonaws.com/images/${doc.type}/${doc.filename}`
},
@jeanbmar jeanbmar added the enhancement New feature or request label Mar 16, 2022
@jeanbmar jeanbmar self-assigned this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant