Skip to content

Commit

Permalink
fix(cc-domain-management): allow newly added domain to be marked as p…
Browse files Browse the repository at this point in the history
…rimary

Fixes #1213
  • Loading branch information
florian-sanders-cc committed Oct 22, 2024
1 parent 1043eea commit 404575d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ defineSmartComponent({
/** @param {{ hostname: string, pathPrefix: string, isWildcard: boolean }} domain */
({ hostname, pathPrefix, isWildcard }) => {
const domainWithPathAndWildcard = getHostWithWildcard(hostname + pathPrefix, isWildcard);
console.log(hostname, pathPrefix, domainWithPathAndWildcard);
updateComponent(
'domainFormState',
/** @param {DomainManagementFormState} domainFormState */
Expand Down Expand Up @@ -107,9 +108,8 @@ defineSmartComponent({
'domainListState',
/** @param {DomainManagementListStateLoaded} domainListState */
(domainListState) => {
const hasPathPrefix = pathPrefix != null && pathPrefix !== '/';
// TODO: once the API returns actual ids, this should be adapted (either refetch or use the API response)
const id = hasPathPrefix ? hostname + pathPrefix : hostname;
const id = hostname + pathPrefix;

/** @type {DomainStateIdle} */
const newDomain = {
Expand Down Expand Up @@ -204,6 +204,7 @@ defineSmartComponent({
updateDomain(id, (domainState) => {
domainState.type = 'marking-primary';
});
console.log(id);

markAsPrimaryDomain({ apiConfig, ownerId, appId, id })
.then(() => {
Expand Down

0 comments on commit 404575d

Please sign in to comment.