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

collection with path in Gitea returns error 400 for DRAFT_MEDIA_FILES #7281

Open
bbaulenas opened this issue Sep 17, 2024 · 0 comments
Open
Labels
type: bug code to address defects in shipped code

Comments

@bbaulenas
Copy link

bbaulenas commented Sep 17, 2024

Hi! I'm facing an error, it's my first time using Decap.

Describe the bug
I've created a collection with a specific path, when i try to create a new object in the admin it keeps loading with an error in console:
GET https://mygitea.com/api/v1/repos/myname/myrepo/git/trees/blog:blog%2Fcontent%2Fblog%2FDRAFT_MEDIA_FILES 400 (Bad Request)

If I remove the collection "path" and media folders, all works as expected.

To Reproduce
Create a collection with this config in a Gitea backend

backend:
  name: gitea
  repo: my-user/my-repo
  app_id: my-app-id
  api_root: https://mygitea.com/api/v1
  base_url: https://mygitea.com
  auth_endpoint: https://mygitea.com/login/oauth/authorize
  branch: blog

site_url: http://localhost
display_url: https://your-site.com

media_folder: "blog/static/uploads"
public_folder: "static/uploads" # la ruta d'imatges que posa decap

collections:
  - name: "blog"
    label: "Blog"
    folder: "blog/content/blog"
    path: '{{year}}/{{month}}/{{slug}}/content'
    media_folder: ''
    public_folder: ''
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields: 
      - { label: "Layout", name: "layout", widget: "hidden", default: "blog" }
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Featured Image", name: "thumbnail", widget: "image" }
      - { label: "Rating (scale of 1-5)", name: "rating", widget: "number" }
      - { label: "Body", name: "body", widget: "markdown" }

Expected behavior
Allow me to create a collection object and store images in "{{year}}/{{month}}/{{slug}}/content"

Applicable Versions:

  • decap-cms-app 3.3.3
  • decap-cms-core 3.4.2
  • decap-cms 3.3.3
  • Git provider: Gitea
@bbaulenas bbaulenas added the type: bug code to address defects in shipped code label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

1 participant