Skip to content

Commit 5f0049f

Browse files
[Dashboard] Add teamId to fee management API calls (#6919)
1 parent 9a63cd4 commit 5f0049f

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

apps/dashboard/src/@/api/universal-bridge/developer.ts

+4
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ export type Fee = {
100100

101101
export async function getFees(props: {
102102
clientId: string;
103+
teamId: string;
103104
}) {
104105
const authToken = await getAuthToken();
105106
const res = await fetch(`${UB_BASE_URL}/v1/developer/fees`, {
106107
method: "GET",
107108
headers: {
108109
"Content-Type": "application/json",
110+
"x-team-id": props.teamId,
109111
"x-client-id-override": props.clientId,
110112
Authorization: `Bearer ${authToken}`,
111113
},
@@ -122,6 +124,7 @@ export async function getFees(props: {
122124

123125
export async function updateFee(props: {
124126
clientId: string;
127+
teamId: string;
125128
feeRecipient: string;
126129
feeBps: number;
127130
}) {
@@ -131,6 +134,7 @@ export async function updateFee(props: {
131134
headers: {
132135
"Content-Type": "application/json",
133136
"x-client-id-override": props.clientId,
137+
"x-team-id": props.teamId,
134138
Authorization: `Bearer ${authToken}`,
135139
},
136140
body: JSON.stringify({

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/connect/universal-bridge/settings/page.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default async function Page(props: {
2727

2828
let fees = await getFees({
2929
clientId: project.publishableKey,
30+
teamId: team.id,
3031
}).catch(() => {
3132
return {
3233
feeRecipient: "",

apps/dashboard/src/components/pay/PayConfig.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const PayConfig: React.FC<PayConfigProps> = (props) => {
4949
}) => {
5050
await updateFee({
5151
clientId: props.project.publishableKey,
52+
teamId: props.teamId,
5253
feeRecipient: values.payoutAddress,
5354
feeBps: values.developerFeeBPS,
5455
});

0 commit comments

Comments
 (0)