-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Document Created with Wrong Relation Field ID and Duplicate ID
Let's Say You have a relational field named categoryID in users collection to link with Categories collection, and also this field has a check as unique fields option in advanced settings. So when new user created it should have a valid categoryID which already exists,
Now There are three cases and please make sure my case is 2nd and 3rd as first one already asked in previous issues.
-
categoryIDnot supplied then user created successfully (not my issue as I know there is notrequired fields feature currently in strapi and it's already asked) -
wrong
categoryIDsupplied and user still created (that's my case), means you can pass any valid 24 digit mongodb ID from any collection (not fromcategories) and it will be accepted without any error ? -
use the same ID again and again it will created new user despite
uniquefields is checked in advanced settings in relational field??
Steps to reproduce the behavior
- Go to 'Admin Panel Content Builder'
- Add new Content Type
Categories - Go to
usercollections and add relational field namecategoryIDto Categories - Go in advanced settings tab and check the
unique field - Create New User from Front End using Strapi SDK or axios with any valid mongodb 24 digit ID and it will created without any error
Expected behavior
It should not create user and throw error that Category with specific ID is not exists or invalid category Id.
System
- Node.js version: 10.16.0
- NPM version: 6.9.0
- Strapi version: 3.0.0-next.11
- Database: MongoDB 3.0.14 Community
- Operating system: Linux Ubuntu 14.04