When adding data to the database, the “_owner” field does not get filled properly.
A whole bunch of data is sended to the database.
when going to a specific page in my account, people see this data in a table
but the data is pulled for them specific (site autor only).
now when the “_owner” field is not filled they only see part of (4 items are filled more then 10 are not filled)
I also just found out that the part where “_owner” is filled, send from the frontend and isn’t used in the backend code(beforeInsert).
But why it works in the frontend and not when it goes trough the backend, i don’t know
@volkaertskristof I think this is not mentioned anywhere in the docs but when you insert from frontend as a site member/admin you have a member id which is used for the ’ _owner ’ field (this is auto detected by the wixData API)
When you insert from backend, the system does not know who you are but since DB permissions may allow the insert due to " suppressAuth: true " value or the DB write permissions being ‘Anyone’ you will not have a ‘_owner’ value for the field because like I said - the server does not know who you are
BUT if you manually get the user id using the below
let owner = wixUsers.currentUser.id;
Then you can send it to your backend to be inserted as the ‘_owner’ field