0

I have AppComponent class defined as

export class AppComponent {
    @ViewChild('scheduleObj')
    public scheduleObj!: ScheduleComponent;
    ----
    ---
    private businessID : string = '999';
    ----
    private currentTimeZone : string = 'Europe/London';

then I have constructor defined as

constructor()   {
      console.log("Constructor Called");
      this.businessID = '12';
      this.currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
    }

Finally I have a Query Object which is passing data to backend APIs

private dataQuery: Query = new Query().from("Appointment").addParams('business_id', this.getBusinessID()).addParams('timezone',this.currentTimeZone);

When I check the Data received in the Backend, I can see this

body: '{"table":"Table1","params":{"location_id":"999","timezone":"Europe/London","StartDate":"2022-05-21T14:00:00.000Z","EndDate":"2022-05-28T14:00:00.000Z"},"location_id":"999","timezone":"Europe/London","StartDate":"2022-05-21T14:00:00.000Z","EndDate":"2022-05-28T14:00:00.000Z"}',
  isBase64Encoded: false

so the values assigned in constructor is not passed to backend. Any clue as to what needs to be done in order to pass the values to goto backend

Sami
  • 9
  • 2
  • Values which should come to backend API should be business_id=12, timezone="Australia/Sydney" – Sami May 24 '22 at 03:36
  • 1
    From where do you call the backend API ? You could check the order of execution by having breakpoints inside constructor and in the place where you call the API. – Nugu May 24 '22 at 04:44
  • Query Object contains the values passed to every API Call in ejs-schedule object – Sami May 24 '22 at 10:22

0 Answers0