Merge pull request #1602 from RafaelTaranto/fix/term-and-conditions-breaking-save

LAM-959 fix: terms and conditions null safety
This commit is contained in:
Rafael Taranto 2023-10-03 16:25:38 +01:00 committed by GitHub
commit 7eb2cc43f9
2 changed files with 3 additions and 2 deletions

View file

@ -61,7 +61,8 @@ const apolloServer = new ApolloServer({
playground: false,
introspection: false,
formatError: error => {
logger.error(error)
const exception = error?.extensions?.exception
logger.error(error, JSON.stringify(exception || {}))
return error
},
context: async (obj) => buildApolloContext(obj)

View file

@ -40,7 +40,7 @@ const md5hash = text =>
const addTermsHash = configs => {
const terms = _.omit(['hash'], getTermsConditions(configs))
return _.isEmpty(terms) ?
return !terms?.text ?
configs :
_.flow(
_.get('text'),