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: {
async updateConfig(obj, args, context) {
try {
if (args.host) {
if (args.hasOwnProperty('host')) {
let siteHost = _.trim(args.host)
if (siteHost.endsWith('/')) {
siteHost = siteHost.slice(0, -1)
}
WIKI.config.host = siteHost
}
if (args.title) {
if (args.hasOwnProperty('title')) {
WIKI.config.title = _.trim(args.title)
}
if (args.company) {
if (args.hasOwnProperty('company')) {
WIKI.config.company = _.trim(args.company)
}
if (args.contentLicense) {
if (args.hasOwnProperty('contentLicense')) {
WIKI.config.contentLicense = args.contentLicense
}
if (args.logoUrl) {
if (args.hasOwnProperty('logoUrl')) {
WIKI.config.logoUrl = _.trim(args.logoUrl)
}
WIKI.config.seo = {
description: _.get(args, 'description', WIKI.config.seo.description),
robots: _.get(args, 'robots', WIKI.config.seo.robots),

Loading…
Cancel
Save