@selfcommunity/react-ui 0.11.0-alpha.113 → 0.11.0-alpha.114

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.
@@ -88,10 +88,14 @@ const TagAutocomplete = (inProps) => {
88
88
  (0, react_1.useEffect)(() => {
89
89
  const loadDefault = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
90
90
  if (typeof defaultValue === 'string' && defaultValue.trim() !== '') {
91
- const results = yield fetchTags('');
92
- const match = results.find((t) => t.id === Number(defaultValue));
93
- if (match) {
94
- setValue(match);
91
+ try {
92
+ const res = yield api_services_1.TagService.getSpecificTag(Number(defaultValue));
93
+ if (res) {
94
+ setValue(res);
95
+ }
96
+ }
97
+ catch (e) {
98
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
95
99
  }
96
100
  }
97
101
  });
@@ -86,10 +86,14 @@ const TagAutocomplete = (inProps) => {
86
86
  useEffect(() => {
87
87
  const loadDefault = () => __awaiter(void 0, void 0, void 0, function* () {
88
88
  if (typeof defaultValue === 'string' && defaultValue.trim() !== '') {
89
- const results = yield fetchTags('');
90
- const match = results.find((t) => t.id === Number(defaultValue));
91
- if (match) {
92
- setValue(match);
89
+ try {
90
+ const res = yield TagService.getSpecificTag(Number(defaultValue));
91
+ if (res) {
92
+ setValue(res);
93
+ }
94
+ }
95
+ catch (e) {
96
+ Logger.error(SCOPE_SC_UI, e);
93
97
  }
94
98
  }
95
99
  });