Skip to content

Commit

Permalink
fix tox text
Browse files Browse the repository at this point in the history
  • Loading branch information
Adeodonne committed Sep 16, 2023
1 parent 8da330f commit d45edfa
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import RelatedFigureApi from '@app/api/streetcode/related-figure.api';
import TextsApi from '@app/api/streetcode/text-content/texts.api';
import useMobx from '@app/stores/root-store';
import PageBar from '@features/AdminPage/PageBar/PageBar.component';
import { useAsync } from '@hooks/stateful/useAsync.hook';
import StreetcodeCoordinate from '@models/additional-content/coordinate.model';
import { ModelState } from '@models/enums/model-state';
import { RelatedFigureCreateUpdate, RelatedFigureUpdate } from '@models/streetcode/related-figure.model';
Expand Down Expand Up @@ -140,7 +141,7 @@ const NewStreetcode = () => {
useEffect(() => {
if (ukUA.DatePicker) {
ukUA.DatePicker.lang.locale = 'uk';
}
}

if (parseId) {
StreetcodeArtApi.getStreetcodeArtsByStreetcodeId(parseId).then((result) => {
Expand Down Expand Up @@ -177,9 +178,7 @@ const NewStreetcode = () => {
setSelectedTags(tagsToUpdate as StreetcodeTag[]);
setFuncName('update');
});
TextsApi.getByStreetcodeId(parseId).then((result) => {
setInputInfo(result);
});

VideosApi.getByStreetcodeId(parseId).then((result) => {
setVideo(result);
});
Expand Down Expand Up @@ -247,6 +246,16 @@ const NewStreetcode = () => {
}
}, []);

useAsync(async () => {
if (parseId !== null) {
await TextsApi.getByStreetcodeId(parseId).then((result) => {
setInputInfo(result);
});
} else {
console.log('Parse id is null');
}
}, [parseId]);

const scrollToErrors = () => {
const errors = form.getFieldsError();
const firstErrorIndex = errors.findIndex((e) => e.errors.length > 0);
Expand Down

0 comments on commit d45edfa

Please sign in to comment.