fix(Delegate): thumbnail and cover removal, logic issue
This commit is contained in:
parent
7d7083a576
commit
d7841b3c47
1 changed files with 16 additions and 6 deletions
|
@ -252,9 +252,14 @@ export default class DelegateController {
|
||||||
let proposedVersion: any = res.locals.organization.proposedVersion
|
let proposedVersion: any = res.locals.organization.proposedVersion
|
||||||
const publishedVersion: any = res.locals.organization.publishedVersion
|
const publishedVersion: any = res.locals.organization.publishedVersion
|
||||||
if (
|
if (
|
||||||
Utils.isStrUsable(proposedVersion, 'thumbnail.location') &&
|
Utils.isStrUsable(proposedVersion, 'thumbnail.location') &&
|
||||||
Utils.isStrUsable(publishedVersion, 'thumbnail.location') &&
|
(
|
||||||
publishedVersion.thumbnail.location !== proposedVersion.thumbnail.location
|
(
|
||||||
|
Utils.isStrUsable(publishedVersion, 'thumbnail.location') &&
|
||||||
|
publishedVersion.thumbnail.location !== proposedVersion.thumbnail.location
|
||||||
|
) ||
|
||||||
|
!Utils.isStrUsable(publishedVersion, 'thumbnail.location')
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
MediaService.delete(proposedVersion.thumbnail.key, 'thumbnailUpdated')
|
MediaService.delete(proposedVersion.thumbnail.key, 'thumbnailUpdated')
|
||||||
}
|
}
|
||||||
|
@ -280,9 +285,14 @@ export default class DelegateController {
|
||||||
let proposedVersion: any = res.locals.organization.proposedVersion
|
let proposedVersion: any = res.locals.organization.proposedVersion
|
||||||
const publishedVersion: any = res.locals.organization.publishedVersion
|
const publishedVersion: any = res.locals.organization.publishedVersion
|
||||||
if (
|
if (
|
||||||
Utils.isStrUsable(proposedVersion, 'cover.location') &&
|
Utils.isStrUsable(proposedVersion, 'cover.location') &&
|
||||||
Utils.isStrUsable(publishedVersion, 'cover.location') &&
|
(
|
||||||
publishedVersion.cover.location !== proposedVersion.cover.location
|
(
|
||||||
|
Utils.isStrUsable(publishedVersion, 'cover.location') &&
|
||||||
|
publishedVersion.cover.location !== proposedVersion.cover.location
|
||||||
|
) ||
|
||||||
|
!Utils.isStrUsable(publishedVersion, 'cover.location')
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
MediaService.delete(proposedVersion.cover.key, 'coverUpdated')
|
MediaService.delete(proposedVersion.cover.key, 'coverUpdated')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue