-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace remaining client axios usage
- Loading branch information
1 parent
94dfde2
commit 521aaf8
Showing
6 changed files
with
22 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { Modal, Button, Icon, Image, Popup } from 'semantic-ui-react'; | |
import firebase from 'firebase/compat/app'; | ||
import 'firebase/compat/auth'; | ||
import { serverPath } from '../../utils'; | ||
import axios from 'axios'; | ||
import { ManageSubButton } from '../SubscribeButton/SubscribeButton'; | ||
import config from '../../config'; | ||
import { MetadataContext } from '../../MetadataContext'; | ||
|
@@ -22,17 +21,16 @@ export class ProfileModal extends React.Component<{ | |
}; | ||
|
||
async componentDidMount() { | ||
const token = await this.context.user?.getIdToken(); | ||
const response = await axios.get<LinkAccount[]>( | ||
serverPath + '/linkAccount', | ||
{ | ||
params: { | ||
uid: this.context.user?.uid, | ||
const token = (await this.context.user?.getIdToken()) ?? ''; | ||
const response = await fetch( | ||
serverPath + | ||
'/linkAccount?' + | ||
new URLSearchParams({ | ||
uid: this.context.user?.uid ?? '', | ||
token, | ||
}, | ||
}, | ||
}), | ||
); | ||
const data = response.data; | ||
const data: LinkAccount[] = await response.json(); | ||
const linkedDiscord = data.find((d) => d.kind === 'discord'); | ||
this.setState({ linkedDiscord }); | ||
} | ||
|
@@ -125,8 +123,9 @@ export class ProfileModal extends React.Component<{ | |
undone. | ||
</p> | ||
<p> | ||
Note: If you have an active subscription, deleting your account will NOT | ||
automatically cancel it and you will need to contact [email protected] to cancel. | ||
Note: If you have an active subscription, deleting your account | ||
will NOT automatically cancel it and you will need to contact | ||
[email protected] to cancel. | ||
</p> | ||
</Modal.Content> | ||
<Modal.Actions> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import axios from 'axios'; | ||
import { serverPath } from './index'; | ||
|
||
export async function generateName(): Promise<string> { | ||
const response = await axios.get<string>(serverPath + '/generateName'); | ||
return response.data; | ||
const response = await fetch(serverPath + '/generateName'); | ||
return response.json(); | ||
} |