View | Details | Raw Unified | Return to bug 36351
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js (-1 / +1 lines)
Lines 139-145 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
139
            const client = APIClient.cataloguing;
139
            const client = APIClient.cataloguing;
140
            client.catalog_bib.create({ frameworkcode, record }).then(
140
            client.catalog_bib.create({ frameworkcode, record }).then(
141
                success => {
141
                success => {
142
                    var record = _fromXMLStruct( data );
142
                    var record = _fromXMLStruct( success );
143
                    if ( record.marcxml ) {
143
                    if ( record.marcxml ) {
144
                        record.marcxml[0].frameworkcode = frameworkcode;
144
                        record.marcxml[0].frameworkcode = frameworkcode;
145
                    }
145
                    }
(-)a/koha-tmpl/intranet-tmpl/prog/js/fetch/http-client.js (-3 / +6 lines)
Lines 38-47 class HttpClient { Link Here
38
            headers: { ...this._headers, ...headers },
38
            headers: { ...this._headers, ...headers },
39
        })
39
        })
40
            .then(response => {
40
            .then(response => {
41
                const is_json = response.headers.get("content-type")?.includes("application/json");
41
                if (!response.ok) {
42
                if (!response.ok) {
42
                    return response.text().then(text => {
43
                    return response.text().then(text => {
43
                        let message;
44
                        let message;
44
                        if (text) {
45
                        if (text && is_json) {
45
                            let json = JSON.parse(text);
46
                            let json = JSON.parse(text);
46
                            message =
47
                            message =
47
                                json.error ||
48
                                json.error ||
Lines 53-59 class HttpClient { Link Here
53
                        throw new Error(message);
54
                        throw new Error(message);
54
                    });
55
                    });
55
                }
56
                }
56
                return return_response ? response : response.json();
57
                if ( return_response || !is_json ) {
58
                    return response;
59
                }
60
                return response.json();
57
            })
61
            })
58
            .then(result => {
62
            .then(result => {
59
                res = result;
63
                res = result;
60
- 

Return to bug 36351