@autofleet/sadot 0.5.4-beta.4 → 0.5.4-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,6 +41,7 @@ const toPascalCase = (str) => str.replace(/(^\w|-\w)/g, (subStr) => subStr.repla
|
|
|
41
41
|
router.post('/', async (req, res) => {
|
|
42
42
|
const { modelName } = req.params;
|
|
43
43
|
const modelType = toPascalCase(modelName);
|
|
44
|
+
logger_1.default.info('sadot Creating custom field definition', { modelName });
|
|
44
45
|
try {
|
|
45
46
|
const validatedPayload = await (0, validations_1.validateCustomFieldDefinitionCreation)(req.body);
|
|
46
47
|
const customFieldDefinition = await DefinitionRepo.create({
|
|
@@ -83,6 +84,7 @@ router.get('/', async (req, res) => {
|
|
|
83
84
|
if (entityIds?.length > 0) {
|
|
84
85
|
where.entityId = entityIds;
|
|
85
86
|
}
|
|
87
|
+
logger_1.default.info('sadot Fetching custom field definitions', { modelType, entityIds, where });
|
|
86
88
|
const customFieldDefinitions = await DefinitionRepo.findAll({ ...where }, { withDisabled: true });
|
|
87
89
|
return res.json(customFieldDefinitions);
|
|
88
90
|
}
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ const toPascalCase = (str: string): string => str.replace(/(^\w|-\w)/g, (subStr)
|
|
|
18
18
|
router.post('/', async (req: Request, res: Response) => {
|
|
19
19
|
const { modelName } = req.params as any;
|
|
20
20
|
const modelType = toPascalCase(modelName);
|
|
21
|
+
logger.info('sadot Creating custom field definition', { modelName });
|
|
21
22
|
try {
|
|
22
23
|
const validatedPayload: CreateCustomFieldDefinition = await
|
|
23
24
|
validateCustomFieldDefinitionCreation(req.body);
|
|
@@ -58,13 +59,14 @@ router.get('/:customFieldDefinitionId', async (req, res) => {
|
|
|
58
59
|
router.get('/', async (req, res) => {
|
|
59
60
|
const { modelName } = req.params as any;
|
|
60
61
|
const { entityIds } = req.query as any;
|
|
61
|
-
|
|
62
62
|
const modelType = toPascalCase(modelName);
|
|
63
63
|
try {
|
|
64
64
|
const where: any = { modelType };
|
|
65
65
|
if (entityIds?.length > 0) {
|
|
66
66
|
where.entityId = entityIds;
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
logger.info('sadot Fetching custom field definitions', { modelType, entityIds, where });
|
|
68
70
|
const customFieldDefinitions = await DefinitionRepo.findAll(
|
|
69
71
|
{ ...where },
|
|
70
72
|
{ withDisabled: true },
|