Relation completition with post

System Information
  • Postgress:

HI, i have a four content types.
USER who has many BUSINESSES but BUSINESSES has only one USER.
BUSINESSES has many FOOD_CATEGORIES but FOOD_CATEGORIES has only one BUSINESSES.
FOOD_CATEGORIES has many FOODS and foods has many categories.

I can make it work perfectly when creating content through strapi, example adding food_category and assign it to a business but how do I make it assign to the selected business automatically when I create with POST on my app.

Thank you!

Hi ther @Rubin_Elezi If you already have a category added, then you need the ID (which you can get from a GET request) and then use the ID to assign it the id. example

// all data goes here that is for food_category
// below is the business id to be assigned
business: 1
1 Like