Skip to content

[Dashboard] Add teamId to fee management API calls #6919

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/dashboard/src/@/api/universal-bridge/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ export type Fee = {

export async function getFees(props: {
clientId: string;
teamId: string;
}) {
const authToken = await getAuthToken();
const res = await fetch(`${UB_BASE_URL}/v1/developer/fees`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-team-id": props.teamId,
"x-client-id-override": props.clientId,
Authorization: `Bearer ${authToken}`,
},
Expand All @@ -122,6 +124,7 @@ export async function getFees(props: {

export async function updateFee(props: {
clientId: string;
teamId: string;
feeRecipient: string;
feeBps: number;
}) {
Expand All @@ -131,6 +134,7 @@ export async function updateFee(props: {
headers: {
"Content-Type": "application/json",
"x-client-id-override": props.clientId,
"x-team-id": props.teamId,
Authorization: `Bearer ${authToken}`,
},
body: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default async function Page(props: {

let fees = await getFees({
clientId: project.publishableKey,
teamId: team.id,
}).catch(() => {
return {
feeRecipient: "",
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/src/components/pay/PayConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const PayConfig: React.FC<PayConfigProps> = (props) => {
}) => {
await updateFee({
clientId: props.project.publishableKey,
teamId: props.teamId,
feeRecipient: values.payoutAddress,
feeBps: values.developerFeeBPS,
});
Expand Down
Loading