I've created a new data schema (using shoutem schema command) that looks like this:
{
"name": "auditlog",
"title": "AuditLog",
"titleProperty": "name",
"type": "object",
"properties": {
"name": {
"format": "single-line",
"title": "Name",
"type": "string",
"displayPriority": 1
},
"type": {
"title": "Type",
"format": "single-line",
"type": "string",
"displayPriority": 2
},
"moreInfo": {
"title": "More Info",
"format": "object",
"type": "object",
"displayPriority": 3
}
}
}
I've connected it to admin pages like this:
"adminPages": [
{
"page": "shoutem.cms.CmsPage",
"title": "Audit Log",
"parameters": {
"schema": "@.AuditLog"
}
}
]
I tested adding a new item from the cms screen and it works perfectly.
Now I am trying to add a new item from react-native mobile app part using redux-io and create method like so:
const item = {
type: ext('AuditLog'),
attributes: {
name: 'Test',
type: 'get',
},
};
const config = {
schema: ext('AuditLog'),
request: {
headers: {
'Content-Type': 'application/vnd.api+json',
accept: 'application/vnd.api+json',
},
},
};
const createAction = create(config, item);
dispatch(createAction);
But when I try to do this, I get the following error:
{
"message":"403 - undefined",
"name":"ApiError",
"response":{
"errors":[
{
"code":"legacy_security_default",
"status":"403",
"title":"Forbidden."
}
]
}
}
Am I missing something that needs to be added to request?