@mondart/nestjs-common-module 1.1.20 → 1.1.21
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.
|
@@ -11,5 +11,8 @@ class ConvertStringCaseHelper {
|
|
|
11
11
|
static camelToKebab(str) {
|
|
12
12
|
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
13
13
|
}
|
|
14
|
+
static snakeToKebab(str) {
|
|
15
|
+
return str.replaceAll('_', '-');
|
|
16
|
+
}
|
|
14
17
|
}
|
|
15
18
|
exports.ConvertStringCaseHelper = ConvertStringCaseHelper;
|
|
@@ -78,7 +78,7 @@ let CoreCrudService = class CoreCrudService {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
if (options?.existsCheck && !result) {
|
|
81
|
-
throw new common_1.NotFoundException(enums_1.SharedMessages.RESOURCE_NOT_FOUND);
|
|
81
|
+
throw new common_1.NotFoundException(helpers_1.MessageFormatter.replace(enums_1.SharedMessages.RESOURCE_NOT_FOUND, `${helpers_1.ConvertStringCaseHelper.snakeToKebab(this.repository.metadata?.tableName)}-id: ${id}`));
|
|
82
82
|
}
|
|
83
83
|
return result;
|
|
84
84
|
}
|