//native
type Vercel = {
token: string;
};
/**
* Get access request status
* Check the status of a join request. It'll respond with a 404 if the request has been declined. If no `userId` path segment was provided, this endpoint will instead return the status of the authenticated user.
*/
export async function main(auth: Vercel, teamId: string, userId: string) {
const url = new URL(
`https://api.vercel.com/v1/teams/${teamId}/request/${userId}`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago