-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Api Server #43
base: rewrite
Are you sure you want to change the base?
Conversation
frontend/src/service/axios.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use axios?
fetch is globally available.
frontend/src/service/httpClient.ts
Outdated
message: string | ||
} | ||
|
||
export async function request<T extends object>({path, method = 'GET', auth = false}: FetchParams) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export async function request<T extends object>({path, method = 'GET', auth = false}: FetchParams) { | |
export async function request<T extends Record<string | number, unknown> | unknown[]>({path, method = 'GET', auth = false}: FetchParams) { |
extends object
is certainly not what you want here, with the extends object
clause will allow any object, e.g request<string>()
is perfectly valid.
export const discordLoginUri = encodeURI(`https://discord.com/oauth2/authorize?client_id=${process.env.REACT_APP_CLIENT_ID}&response_type=code&redirect_uri=${process.env.REACT_APP_REDIRECT_URL}&scope=identify+guilds`); | ||
|
||
export function getUserAvatar(id: string, hash: string) { | ||
return `https://media.discordapp.net/avatars/${id}/${hash}.png?size=64`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the cdn, not the media proxy
No description provided.