Directus Relationship problems on update or create entities

13 views Asked by At

I want to create a new match that store 2 teams of already existin player. TeamA and teamB. I tryed o2m/m2o and m2m. there is no way to get this work.

when i post a new match to create it via the api :

{
mathName : 'toto',
teamA : [1,2,3], //array of existing player ids
teamB:[4,5,6], //array of existing player ids
}

I get a 403 forbidden. (all permissons are allowed)

When i use directus administration to asign player to teamA and teamB on a new match creation, it works like a charm. When i use my api to fetch this match, i get the expected result: a match name and 2 array of player ids representing teamA and teamB.

i tryed differents way to post my Data. from my app and from postman. I cannot find any documentation anywhere on that problem.

It looks to me that this is supposed to be a simple thing. But i spend 2 days on it and still cant get it work. Any idea would be greatly appreciated?

0

There are 0 answers