Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: profile sub domain (#9811)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude authored Nov 21, 2023
1 parent 6c5cb16 commit 159e219
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions pages/api/account/manage/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,38 +199,6 @@ export async function updateSettingsApi(context, username, data) {

// add new custom domain
if (data.domain) {
log.info(
`attempting to add domain "${data.domain}" to the team for: ${username}`,
);
let domainAddRes;
const domainAddUrl = `https://api.vercel.com/v5/domains?teamId=${serverEnv.VERCEL_TEAM_ID}`;
const domainAddUrlError = `failed to add new team custom domain "${data.domain}" for username: ${username}`;
let domainAddJson;
try {
domainAddRes = await fetch(domainAddUrl, {
method: "POST",
headers: {
Authorization: `Bearer ${serverEnv.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: data.domain }),
});
domainAddJson = await domainAddRes.json();
if (domainAddJson.error) {
updateDomain(username, beforeUpdate.domain);
log.error(domainAddUrlError);
return { error: domainAddUrlError };
}
log.info(
domainAddJson,
`domain ${data.domain} added to team for: ${username}`,
);
} catch (e) {
updateDomain(username, beforeUpdate.domain);
log.error(e, domainAddUrlError);
return { error: domainAddUrlError };
}

log.info(
`attempting to add domain "${data.domain}" to the project for: ${username}`,
);
Expand Down

0 comments on commit 159e219

Please sign in to comment.