Skip to content

Commit

Permalink
fix(webhosting): add missing post body (#1370)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan R. <[email protected]>
  • Loading branch information
scaleway-bot and jremy42 authored Jul 22, 2024
1 parent 9afb0ac commit 6347911
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/clients/src/api/webhosting/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import type { Region, WaitForOptions } from '../../../bridge'
import { HOSTING_TRANSIENT_STATUSES } from './content.gen'
import {
marshalCheckUserOwnsDomainRequest,
marshalCreateHostingRequest,
marshalUpdateHostingRequest,
unmarshalCheckUserOwnsDomainResponse,
Expand Down Expand Up @@ -235,12 +236,12 @@ export class API extends ParentAPI {
checkUserOwnsDomain = (request: Readonly<CheckUserOwnsDomainRequest>) =>
this.client.fetch<CheckUserOwnsDomainResponse>(
{
body: JSON.stringify(
marshalCheckUserOwnsDomainRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/check-ownership`,
urlParams: urlParams([
'project_id',
request.projectId ?? this.client.settings.defaultProjectId,
]),
},
unmarshalCheckUserOwnsDomainResponse,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../../../bridge'
import type { DefaultValues } from '../../../bridge'
import type {
CheckUserOwnsDomainRequest,
CheckUserOwnsDomainResponse,
ControlPanel,
CreateHostingRequest,
Expand Down Expand Up @@ -278,6 +279,13 @@ export const unmarshalSession = (data: unknown): Session => {
} as Session
}

export const marshalCheckUserOwnsDomainRequest = (
request: CheckUserOwnsDomainRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
project_id: request.projectId ?? defaults.defaultProjectId,
})

const marshalCreateHostingRequestDomainConfiguration = (
request: CreateHostingRequestDomainConfiguration,
defaults: DefaultValues,
Expand Down

0 comments on commit 6347911

Please sign in to comment.