Skip to content

Include file names for files in a table #7

@kartiknair

Description

@kartiknair

Hey there! Really like this project & have found it very helpful to create a simple CMS of sorts.

I just have one issue & that is that the api doesn't return file names, but rather just an array of URLs. For example here's an example notion page & this is potion's api response for it. It would be very helpful to provide the filenames in the response to show attachments on the client side for example.

I have a solution for it working locally it's just a small change in the api/table.js file, just wondering if this would be an ok PR. Especially because it is a breaking change to the table api.

Here is the change btw:

files.forEach((file) => {
  const s3Url = file[1][0][1]
  outputFiles.push({
    name: file[0],
    url: getAssetUrl(s3Url, page.value.id)
  })
})

instead of just pushing the url to output files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions