From f9614b55fbfffdebd3fcb4e0731d7cedb63b7189 Mon Sep 17 00:00:00 2001 From: lefuturiste Date: Thu, 30 Jul 2020 12:59:36 +0200 Subject: [PATCH] feat: clean object before showing changes --- src/views/Admin/OrganizationList.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/views/Admin/OrganizationList.vue b/src/views/Admin/OrganizationList.vue index 20adc75..1f58232 100644 --- a/src/views/Admin/OrganizationList.vue +++ b/src/views/Admin/OrganizationList.vue @@ -677,12 +677,25 @@ export default { openDiffModal () { this.diffModal = true + const clean = unordered => { + // Object.keys(unordered).sort().forEach(key => { + // ordered[key] = unordered[key] + // }) + return { + name: unordered.name, + descriptionShort: unordered.descriptionShort, + descriptionLong: unordered.descriptionLong, + thumbnail: unordered.thumbnail, + contacts: unordered.contacts, + ...unordered + } + } this.diffText = diff( JSON.stringify( - this.toApproveItem.publishedVersion, '', 2 + clean(this.toApproveItem.publishedVersion), '', 2 ), JSON.stringify( - this.toApproveItem.proposedVersion, '', 2 + clean(this.toApproveItem.proposedVersion), '', 2 ), { green: (v) => '' + v + '',