Skip to content

Commit

Permalink
fix: update incorrect memo structure key in sage300 advanced settings…
Browse files Browse the repository at this point in the history
… payload (#1138)
  • Loading branch information
1 parent aefcef5 commit c159616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ExpenseFilterPost, ExpenseFilterPayload, ConditionField } from "../../c
import { JoinOption, Operator } from "../../enum/enum.model";

export type Sage300AdvancedSetting = {
memo_structure: string[],
expense_memo_structure: string[],
schedule_is_enabled: boolean,
auto_create_vendor: boolean,
interval_hours: number
Expand All @@ -23,7 +23,7 @@ export class Sage300AdvancedSettingModel {
static mapAPIResponseToFormGroup(advancedSettings: Sage300AdvancedSettingGet | null, isSkipExportEnabled: boolean): FormGroup {
const defaultMemoOptions: string[] = ['employee_email', 'purpose', 'category', 'spent_on', 'report_number', 'expense_link'];
return new FormGroup({
memoStructure: new FormControl(advancedSettings?.memo_structure ? advancedSettings?.memo_structure : defaultMemoOptions),
memoStructure: new FormControl(advancedSettings?.expense_memo_structure ? advancedSettings?.expense_memo_structure : defaultMemoOptions),
scheduleEnabled: new FormControl(advancedSettings?.schedule_is_enabled ? true : false),
autoCreateVendor: new FormControl(advancedSettings?.auto_create_vendor ? true : false),
scheduleAutoExportFrequency: new FormControl(advancedSettings?.interval_hours ? advancedSettings.interval_hours : 1),
Expand All @@ -33,7 +33,7 @@ export class Sage300AdvancedSettingModel {

static createAdvancedSettingPayload(advancedSettingsForm: FormGroup): Sage300AdvancedSettingPost {
return {
memo_structure: advancedSettingsForm.get('memoStructure')?.value ? advancedSettingsForm.get('memoStructure')?.value : null,
expense_memo_structure: advancedSettingsForm.get('memoStructure')?.value ? advancedSettingsForm.get('memoStructure')?.value : null,
schedule_is_enabled: advancedSettingsForm.get('scheduleEnabled')?.value ? advancedSettingsForm.get('scheduleEnabled')?.value : false,
interval_hours: advancedSettingsForm.get('scheduleEnabled')?.value ? advancedSettingsForm.get('scheduleAutoExportFrequency')?.value : null,
auto_create_vendor: advancedSettingsForm.get('autoCreateVendor')?.value ? advancedSettingsForm.get('autoCreateVendor')?.value : false
Expand Down
2 changes: 1 addition & 1 deletion src/app/integrations/sage300/sage300-shared/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const sage300FieldsResponse: IntegrationField[] =
];

export const sage300AdvancedSettingResponse: Sage300AdvancedSettingGet = {
memo_structure: [
expense_memo_structure: [
"employee_email",
"category",
"spent_on",
Expand Down

0 comments on commit c159616

Please sign in to comment.