Skip to content

Commit

Permalink
Add costCenterCustomFields settings default
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmast committed Feb 10, 2023
1 parent 216189a commit 047d69b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions node/resolvers/Queries/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const B2BSettings = {
// create schema if it doesn't exist
await checkConfig(ctx)

let settings = null
let settings: Partial<B2BSettingsInput> | null = null

try {
settings = await vbase.getJSON<B2BSettingsInput | null>(
Expand All @@ -23,7 +23,8 @@ const B2BSettings = {

settings = {
...settings,
// if organizationCustomFields is null, set it to an empty array
// if custom fields are null, set to an empty array
costCenterCustomFields: settings?.costCenterCustomFields ?? [],
organizationCustomFields: settings?.organizationCustomFields ?? [],
}
} catch (e) {
Expand Down

0 comments on commit 047d69b

Please sign in to comment.