getAct
getAct: (service: keyof typeof acts, schema: string, actName: string)
Get specific action of schema of specific service
Example
const cities = coreApp.odm.newModel("city", locationPure, {});
const setAddCityAct = coreApp.acts.setAct({
schema: "city",
actName: "addCity",
validator: addCityValidator(),
fn: addCity,
});
const getCountryActs = coreApp.acts.getAct("main", "country", "addCountry");
Return Of Example
{
"validator": {
"type": "object",
"schema": {
"set": {
"type": "object",
"schema": {
"name": {
"type": "string",
"schema": null
},
"population": {
"type": "number",
"schema": null
},
"abb": {
"type": "string",
"schema": null
},
"isCapital": {
"type": "boolean",
"schema": null
},
"country": {
"type": "union",
"schema": null
}
}
},
"get": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"population": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"abb": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"country": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"population": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"abb": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
},
"users": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"age": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
},
"lovedByUser": {
"type": "object",
"schema": {
"_id": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"name": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
},
"age": {
"type": "enums",
"schema": {
"0": 0,
"1": 1
}
}
}
}
}
}
}
},
"validationRunType": "assert"
}
Parameters
service: keyof typeof acts,
acts: Services
schema: string,
actName: string