Skip to content

Commit

Permalink
chore: Update Profile API endpoints (pancakeswap#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefKai authored Feb 15, 2021
1 parent 9e83ff7 commit 9466564
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_API_PROFILE = https://pancake-profile-api.vercel.app
REACT_APP_API_PROFILE = https://profile.pancakeswap.com
2 changes: 1 addition & 1 deletion src/state/profile/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface GetProfileResponse {

const getUsername = async (address: string): Promise<string> => {
try {
const response = await fetch(`${profileApi}/api/users?address=${address}`)
const response = await fetch(`${profileApi}/api/users/${address}`)

if (!response.ok) {
return ''
Expand Down
4 changes: 2 additions & 2 deletions src/views/Profile/ProfileCreation/UserName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const UserName: React.FC = () => {
const checkUsernameValidity = debounce(async (value: string) => {
try {
setIsLoading(true)
const res = await fetch(`${profileApiUrl}/api/users/valid?username=${value}`)
const res = await fetch(`${profileApiUrl}/api/users/valid/${value}`)

if (res.ok) {
setIsValid(true)
Expand Down Expand Up @@ -144,7 +144,7 @@ const UserName: React.FC = () => {
useEffect(() => {
const fetchUser = async () => {
try {
const response = await fetch(`${profileApiUrl}/api/users?address=${account}`)
const response = await fetch(`${profileApiUrl}/api/users/${account}`)
const data = await response.json()

if (response.ok) {
Expand Down

0 comments on commit 9466564

Please sign in to comment.