refacor(documents): Switch to new document-server
This commit is contained in:
parent
1d55445c1b
commit
721892c315
@ -4,7 +4,7 @@ const config = {
|
|||||||
// required, with trailing slash
|
// required, with trailing slash
|
||||||
baseurl: '',
|
baseurl: '',
|
||||||
// full url (including fqdn)
|
// full url (including fqdn)
|
||||||
baseurl_documentserver: 'http://localhost:4010/documents',
|
baseurl_documentserver: 'http://localhost:3000',
|
||||||
// optional, will fallback to code128
|
// optional, will fallback to code128
|
||||||
code_format: 'ean13',
|
code_format: 'ean13',
|
||||||
// optional, will fallback to /imprint
|
// optional, will fallback to /imprint
|
||||||
|
@ -589,12 +589,36 @@ function get_certificate() {
|
|||||||
(navigator.languages && navigator.languages[0]) ||
|
(navigator.languages && navigator.languages[0]) ||
|
||||||
""
|
""
|
||||||
).substr(0, 2);
|
).substr(0, 2);
|
||||||
let url = `${config.baseurl_documentserver}certificates?locale=${browserlocale}&download=true&key=${config.documentserver_key}`;
|
let url = `${config.baseurl_documentserver}/v1/pdfs/certificates?key=${config.documentserver_key}`;
|
||||||
let postdata = Object.assign({}, state.fullobject);
|
let postdata = {
|
||||||
postdata.group = {
|
locale: browserlocale,
|
||||||
name: postdata.group,
|
runners: [
|
||||||
|
{
|
||||||
|
first_name: state.firstname,
|
||||||
|
middle_name: state.middlename,
|
||||||
|
last_name: state.lastname,
|
||||||
|
id: state.fullobject.id,
|
||||||
|
distance: state.fullobject.distance,
|
||||||
|
group: {
|
||||||
|
name: state.group,
|
||||||
|
id: state.fullobject.group.id || 0,
|
||||||
|
},
|
||||||
|
distance_donations: state.fullobject.distanceDonations.map((s) => {
|
||||||
|
return {
|
||||||
|
id: s.id || 0,
|
||||||
|
amount: s.amount,
|
||||||
|
amount_per_distance: s.amountPerDistance,
|
||||||
|
donor: {
|
||||||
|
id: s.donor.id || 0,
|
||||||
|
first_name: s.donor.firstname,
|
||||||
|
middle_name: s.donor.middlename,
|
||||||
|
last_name: s.donor.lastname,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
postdata = [postdata];
|
|
||||||
axios
|
axios
|
||||||
.post(url, postdata, {
|
.post(url, postdata, {
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user