Skip to content

Commit

Permalink
Disable custom data fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
kaenganxt committed Dec 17, 2023
1 parent e1bea10 commit 1d48ab3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface NotifySettings {

export class EkklesiaBeoSettings extends React.Component {
static contextType = AccountServiceContext;
context: React.ContextType<typeof AccountServiceContext>;
//context: React.ContextType<typeof AccountServiceContext>;

private readonly DEFAULT_STATE: NotifySettings = {
formFields: {},
Expand All @@ -36,7 +36,7 @@ export class EkklesiaBeoSettings extends React.Component {
}

fetchPersonalInfo() {
this.context!.doGet<FormFields>("/")
/*this.context!.doGet<FormFields>("/")
.then((response: HttpResponse<FormFields>) => {
this.setState(this.DEFAULT_STATE);
const formFields = response.data;
Expand All @@ -54,7 +54,7 @@ export class EkklesiaBeoSettings extends React.Component {
}
this.setState({...{ formFields: formFields }});
});
});*/
}

private handleChange = (value: string, event: React.FormEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -93,13 +93,13 @@ export class EkklesiaBeoSettings extends React.Component {
reqData.attributes!.notify_matrix_ids = matrixIds.filter(id => id);
this.setState({...{ formFields: reqData }});

this.context!.doPost<void>("/", reqData)
/*this.context!.doPost<void>("/", reqData)
.then(() => {
ContentAlert.success('accountUpdatedMessage');
})
.catch(() => {
ContentAlert.warning("accountUpdateFailedReload");
});
});*/
}

private addMatrix = (): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface SyncInformation {

export class EkklesiaSyncPage extends React.Component {
static contextType = AccountServiceContext;
context: React.ContextType<typeof AccountServiceContext>;
//context: React.ContextType<typeof AccountServiceContext>;
private readonly DEFAULT_ATTRIBUTES: SyncInformation = {
ekklesia_first_sync: null,
ekklesia_last_sync: null,
Expand All @@ -58,14 +58,14 @@ export class EkklesiaSyncPage extends React.Component {
}

private fetchPersonalInfo(): void {
this.context!.doGet("/").then((response: any) => {
/*this.context!.doGet("/").then((response: any) => {
this.setState(this.DEFAULT_STATE);
let formData = response.data as FormFields;
if (!formData.attributes) {
formData.attributes = this.DEFAULT_ATTRIBUTES;
}
this.setState({ ...{formFields: formData} });
});
});*/
}

private handleChange = (value: string, event: React.FormEvent<HTMLInputElement>) => {
Expand All @@ -78,10 +78,10 @@ export class EkklesiaSyncPage extends React.Component {
event.preventDefault();

const reqData = { ...this.state.formFields };
this.context!.doPost<void>("/", reqData)
/*this.context!.doPost<void>("/", reqData)
.then(() => {
ContentAlert.success('accountUpdatedMessage');
});
});*/
}

public render(): React.ReactNode {
Expand Down

0 comments on commit 1d48ab3

Please sign in to comment.