From 8acf962864e1e9942a0e75aa5dd8aa569645e384 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 26 Dec 2022 15:29:45 -0600 Subject: [PATCH] Update:Remove relImagePath from Author entity --- client/components/modals/authors/EditModal.vue | 6 ++---- server/controllers/AuthorController.js | 2 -- server/objects/entities/Author.js | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/client/components/modals/authors/EditModal.vue b/client/components/modals/authors/EditModal.vue index 4026ba76..28f739d6 100644 --- a/client/components/modals/authors/EditModal.vue +++ b/client/components/modals/authors/EditModal.vue @@ -125,8 +125,7 @@ export default { }, async removeCover() { var updatePayload = { - imagePath: null, - relImagePath: null + imagePath: null } this.processing = true var result = await this.$axios.$patch(`/api/authors/${this.authorId}`, updatePayload).catch((error) => { @@ -161,8 +160,7 @@ export default { if (response.author.imagePath) { this.$toast.success(this.$strings.ToastAuthorUpdateSuccess) this.$store.commit('globals/showEditAuthorModal', response.author) - } - else this.$toast.success(this.$strings.ToastAuthorUpdateSuccessNoImageFound) + } else this.$toast.success(this.$strings.ToastAuthorUpdateSuccessNoImageFound) } else { this.$toast.info('No updates were made for Author') } diff --git a/server/controllers/AuthorController.js b/server/controllers/AuthorController.js index 8cfe3d1b..0639d005 100644 --- a/server/controllers/AuthorController.js +++ b/server/controllers/AuthorController.js @@ -80,7 +80,6 @@ class AuthorController { await this.cacheManager.purgeImageCache(req.author.id) // Purge cache } payload.imagePath = imageData.path - payload.relImagePath = imageData.relPath hasUpdated = true } } @@ -181,7 +180,6 @@ class AuthorController { var imageData = await this.authorFinder.saveAuthorImage(req.author.id, authorData.image) if (imageData) { req.author.imagePath = imageData.path - req.author.relImagePath = imageData.relPath hasUpdates = true } } diff --git a/server/objects/entities/Author.js b/server/objects/entities/Author.js index 463c9cac..179b92bd 100644 --- a/server/objects/entities/Author.js +++ b/server/objects/entities/Author.js @@ -9,7 +9,6 @@ class Author { this.name = null this.description = null this.imagePath = null - this.relImagePath = null this.addedAt = null this.updatedAt = null @@ -24,7 +23,6 @@ class Author { this.name = author.name || '' this.description = author.description || null this.imagePath = author.imagePath - this.relImagePath = author.relImagePath this.addedAt = author.addedAt this.updatedAt = author.updatedAt } @@ -36,7 +34,6 @@ class Author { name: this.name, description: this.description, imagePath: this.imagePath, - relImagePath: this.relImagePath, addedAt: this.addedAt, updatedAt: this.updatedAt } @@ -61,7 +58,6 @@ class Author { this.description = data.description || null this.asin = data.asin || null this.imagePath = data.imagePath || null - this.relImagePath = data.relImagePath || null this.addedAt = Date.now() this.updatedAt = Date.now() }