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) {
return ErrorController.notFoundHandler()(req, res)
}
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) => {
if (phone.indexOf('+33') === 0) {
phone = '0' + phone.substr(3)
@ -136,7 +132,6 @@ export default class PublicController {
return p
})
}
if (Utils.isStrUsable(version.contacts, 'facebook')) {
try {
version.contacts.facebookLabel = new URL(version.contacts.facebook).pathname.replace('/', '')