Browse Source

If the host, title, company, contentLicense, logoUrl is empty then the old value is updated on Administrator General setting. fix the issue

pull/5165/head
rajatchauhanyti 3 years ago
parent
commit
6e8b50507f
1 changed files with 5 additions and 10 deletions
  1. 15
      server/graph/resolvers/site.js

15
server/graph/resolvers/site.js

@ -38,30 +38,25 @@ module.exports = {
SiteMutation: { SiteMutation: {
async updateConfig(obj, args, context) { async updateConfig(obj, args, context) {
try { try {
if (args.host) {
if (args.hasOwnProperty('host')) {
let siteHost = _.trim(args.host) let siteHost = _.trim(args.host)
if (siteHost.endsWith('/')) { if (siteHost.endsWith('/')) {
siteHost = siteHost.slice(0, -1) siteHost = siteHost.slice(0, -1)
} }
WIKI.config.host = siteHost WIKI.config.host = siteHost
} }
if (args.title) {
if (args.hasOwnProperty('title')) {
WIKI.config.title = _.trim(args.title) WIKI.config.title = _.trim(args.title)
} }
if (args.company) {
if (args.hasOwnProperty('company')) {
WIKI.config.company = _.trim(args.company) WIKI.config.company = _.trim(args.company)
} }
if (args.contentLicense) {
if (args.hasOwnProperty('contentLicense')) {
WIKI.config.contentLicense = args.contentLicense WIKI.config.contentLicense = args.contentLicense
} }
if (args.logoUrl) {
if (args.hasOwnProperty('logoUrl')) {
WIKI.config.logoUrl = _.trim(args.logoUrl) WIKI.config.logoUrl = _.trim(args.logoUrl)
} }
WIKI.config.seo = { WIKI.config.seo = {
description: _.get(args, 'description', WIKI.config.seo.description), description: _.get(args, 'description', WIKI.config.seo.description),
robots: _.get(args, 'robots', WIKI.config.seo.robots), robots: _.get(args, 'robots', WIKI.config.seo.robots),

Loading…
Cancel
Save