fix: default cover key error

This commit is contained in:
Matthieu Bessat 2020-08-11 00:20:20 +02:00
parent d7841b3c47
commit 922b3caa28

View file

@ -95,14 +95,10 @@ export default class PublicController {
} else if (lastPublished === undefined || lastPublished === null) { } else if (lastPublished === undefined || lastPublished === null) {
return ErrorController.notFoundHandler()(req, res) return ErrorController.notFoundHandler()(req, res)
} }
if (!Utils.isStrUsable(version, 'cover.location')) { if (!Utils.isStrUsable(version, 'cover.location')) {
version.cover.location = "https://fva-condorcet.s3.fr-par.scw.cloud/default-cover-plz-get-you-a-real-image.jpg" version.cover = { location: "https://fva-condorcet.s3.fr-par.scw.cloud/default-cover-plz-get-you-a-real-image.jpg" }
} }
// if (lastPublished !== null) {
// lastPublished = lastPublished
// }
let formatPhone = (phone: string) => { let formatPhone = (phone: string) => {
if (phone.indexOf('+33') === 0) { if (phone.indexOf('+33') === 0) {
phone = '0' + phone.substr(3) phone = '0' + phone.substr(3)
@ -136,7 +132,6 @@ export default class PublicController {
return p return p
}) })
} }
if (Utils.isStrUsable(version.contacts, 'facebook')) { if (Utils.isStrUsable(version.contacts, 'facebook')) {
try { try {
version.contacts.facebookLabel = new URL(version.contacts.facebook).pathname.replace('/', '') version.contacts.facebookLabel = new URL(version.contacts.facebook).pathname.replace('/', '')