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

Relating a file (upload) to a model (One to many) #237

Closed
madd86 opened this issue Aug 22, 2017 · 0 comments
Closed

Relating a file (upload) to a model (One to many) #237

madd86 opened this issue Aug 22, 2017 · 0 comments
Assignees

Comments

@madd86
Copy link

madd86 commented Aug 22, 2017

Node.js version: 8.2.1
npm version: 5.3.0
Strapi version: 1.6.3
Operating system: Ubuntu 16.04.3

So I enabled the upload module and I need to have an upload field on my model.

I added the relationship but I don't know how to post it.

I.e.:

[CAR MODEL API]

  • Model

  • Color

  • Year

  • Picture (related to upload)

However, when I go to post a multipart with the file I get this:

{
	"error": "E_VALIDATION",
	"status": 400,
	"summary": "3 attributes are invalid",
	"model": "car",
	"invalidAttributes": {
		"model": [
			{
				"rule": "required",
				"message": "Missing attributes model"
			}
		],
		"color": [
			{
				"rule": "required",
				"message": "Missing attributes color"
			}
		],
		"year": [
			{
				"rule": "required",
				"message": "Missing attributes year"
			}
		]
	}
}

It doesn't show the field, how does this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants