Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 669ffe38

Přidáno uživatelem Jaroslav Hrubý před asi 2 roky(ů)

Refactoring after code review

Zobrazit rozdíly:

webapp/components/modals/AssignDocumentModal.tsx
5 5
import { annotationController, userController } from '../../controllers';
6 6
import { useUnauthRedirect } from '../../hooks';
7 7
import { LoggedUserContext } from '../../contexts/LoggedUserContext';
8
import { ShowToast } from '../../utils/alerts';
8 9

  
9 10
interface ModalProps {
10 11
    onCancel: () => void;
......
37 38
    const handleUpload = async () => {
38 39
        // console.log(documentsIds, selectedUsers);
39 40
        if (documentsIds && documentsIds.length !== 0) {
40
            await annotationController.annotationsPost({
41
                // @ts-ignore
42
                documentIdList: documentsIds,
43
                userIdList: selectedUsers,
44
            });
41
            await annotationController
42
                .annotationsPost({
43
                    // @ts-ignore
44
                    documentIdList: documentsIds,
45
                    userIdList: selectedUsers,
46
                })
47
                .then((r) => {
48
                    ShowToast(
49
                        'Přiřazení dokumentů proběhlo úspěšně',
50
                        'success',
51
                        3000,
52
                        'top-end'
53
                    );
54
                    onCancel();
55
                });
45 56
        }
46
        onCancel();
47 57
    };
48 58

  
49 59
    function onChange(event: any) {

Také k dispozici: Unified diff