From 333fe353a7fbdce50ee5981d393a7fcbafd109a4 Mon Sep 17 00:00:00 2001 From: Salah Awad Date: Mon, 8 Nov 2021 21:55:08 +0100 Subject: [PATCH] Fixing the image url --- app/models/Company.js | 4 ++-- app/models/User.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/Company.js b/app/models/Company.js index daf9344..3e722ba 100644 --- a/app/models/Company.js +++ b/app/models/Company.js @@ -194,7 +194,7 @@ schema.methods.compareRowPassword = function (password, callback) { schema.virtual("fullpicture").get(function () { let fullpicture = ""; if (this.picture.length > 2) { - fullpicture = _config("app.imageurl") + this.picture; + fullpicture = `/upload/${this.picture}`; } return fullpicture; }); @@ -202,7 +202,7 @@ schema.virtual("fullpicture").get(function () { schema.virtual("fullcover").get(function () { let fullcover = ""; if (this.cover.length > 2) { - fullcover = _config("app.imageurl") + this.cover; + fullcover = `/upload/${this.cover}`; } return fullcover; }); diff --git a/app/models/User.js b/app/models/User.js index c783a75..4267b7b 100644 --- a/app/models/User.js +++ b/app/models/User.js @@ -229,14 +229,14 @@ schema.methods.compareRowPassword = function (password, callback) { schema.virtual("fullpicture").get(function () { let fullpicture = ""; if (this.picture && this.picture.length > 2) { - fullpicture = _config("app.imageurl") + this.picture; + fullpicture = `/upload/${this.picture}`; } return fullpicture; }); schema.virtual("fullcover").get(function () { let fullcover = ""; if (this.cover && this.cover.length > 2) { - fullcover = _config("app.imageurl") + this.cover; + fullcover = `/upload/${this.cover}`; } return fullcover; }); @@ -244,7 +244,7 @@ schema.virtual("fullcover").get(function () { schema.virtual("fullcv").get(function () { let fullcv = ""; if (this.cv && this.cv.length > 2) { - fullcv = _config("app.imageurl") + this.cv; + fullcv = `/upload/${this.cv}`; } return fullcv; });