Projekt

Obecné

Profil

« Předchozí | Další » 

Revize fe068d3a

Přidáno uživatelem Michal Schwob před více než 2 roky(ů)

External sources sending file fixed
re #9821

Zobrazit rozdíly:

frontend/src/features/ExternalSources/ExternalSources.tsx
31 31
        validationSchema,
32 32
        onSubmit: async (values) => {
33 33
            setFileProcessing(true)
34
            const reader = new FileReader()
35
            reader.readAsText(values.file as File)
36
            reader.onload = async () => {
37
                const {data, status} = await axiosInstance.post(
38
                   '/external-catalog-item',
39
                   { file: reader.result as string }
40
                )
41
                if (status !== 200) {
42
                    console.log("Error in updating catalog")
43
                }
34
            const formData = new FormData()
35
            // @ts-ignore
36
            formData.append("file", values.file)
37

  
38
            const {data, status} = await axiosInstance.post(
39
               '/external-catalog-items',
40
               formData,
41
                {headers: {
42
                'Content-Type': 'multipart/form-data'
43
                }}
44
            )
45
            if (status !== 200) {
46
                console.log("Error in updating catalog")
44 47
            }
48
            console.log("ex cat post status: " + status)
49

  
45 50
        },
46 51
    })
47 52

  
......
84 89
            <Paper style={{ minHeight: '80vh' }} variant="outlined">
85 90
                <Container sx={{ mt: 4 }}>
86 91
                    <Typography sx={{ mb: 2 }}>
87
                        Select file with sources from ... source and then click submit to update all external sources.
92
                        Please upload CSV file from CIGS available at https://zenodo.org/record/5642899#.YoeJLXXP1hE
93
                        (please check version, there might be newer).
94
                    </Typography>
95
                    <Typography sx={{ mb: 3 }}>
96
                        Files from Pleiades (available at https://pleiades.stoa.org/
97
                        , downloads at http://atlantides.org/downloads/pleiades/dumps/
98
                        ), ANE (available at https://www.lingfil.uu.se/research/assyriology/earth/
99
                        , downloads at https://zenodo.org/record/6384045
100
                        ) and GeoNames (available at https://www.geonames.org/
101
                        ) will be added automatically.
88 102
                    </Typography>
89 103
                    <SingleFileSelectionForm
90 104
                        onFileSelected={onFileSelected}

Také k dispozici: Unified diff