Hi everyone,
I’m encountering an issue when trying to create a Freelancer with a one-to-one relation to a User. Here’s the error message I’m getting:
json
Copy code
{
“data”: null,
“error”: {
“status”: 400,
“name”: “ValidationError”,
“message”: “Invalid key user”,
“details”: {
“key”: “user”,
“path”: “user”,
“source”: “body”
}
}
}
This is the POST request I’m sending:
json
Copy code
{
“data”: {
“user”: {
“connect”: [“ssbt9wjmgfyakdqbnslatoge”]
},
“full_name”: “John Doe”,
“bio”: “Experienced web developer with a passion for creating responsive and user-friendly websites.”
}
}
For reference, here’s the User data I’m trying to connect:
json
Copy code
{
“id”: 10,
“documentId”: “ssbt9wjmgfyakdqbnslatoge”,
“username”: “TanmayFreelancer”,
“email”: “tanmayjha@gmail.com”,
“provider”: “local”,
“confirmed”: true,
“blocked”: false,
“createdAt”: “2024-10-10T20:30:21.642Z”,
“updatedAt”: “2024-10-10T20:30:21.642Z”,
“publishedAt”: “2024-10-10T20:30:21.642Z”,
“locale”: null,
“userType”: “Freelancer”
}
I’ve already set up a one-to-one relationship between User and Freelancer in Strapi, but I can’t figure out why the key “user” is being marked as invalid. Any ideas on what might be causing this or what I’m doing wrong?
Thanks in advance for any help!
This topic has been created from a Discord post (1294042107211813049) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord