Skip to content

Commit 62685cb

Browse files
tylerpinaclaude
andauthored
fix: make ExperienceSys.componentType optional for template-backed experiences [DX-980] (#3003)
* fix: field made optional * fix: guard optional componentType access in experience update endpoint [DX-980] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d70c2c9 commit 62685cb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/adapters/REST/endpoints/experience.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export const update: RestEndpoint<'Experience', 'update'> = (
5858
headers?: RawAxiosRequestHeaders,
5959
) => {
6060
const data: SetOptional<typeof rawData, 'sys'> & { componentTypeId?: string } = copy(rawData)
61-
data.componentTypeId = rawData.sys.componentType.sys.id
61+
if (rawData.sys.componentType) {
62+
data.componentTypeId = rawData.sys.componentType.sys.id
63+
}
6264
delete data.sys
6365
return raw.put<ExperienceProps>(http, getBaseUrl(params) + `/${params.experienceId}`, data, {
6466
headers: {

lib/entities/experience.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type ExperienceSys = {
2929
version: number
3030
space: Link<'Space'>
3131
environment: Link<'Environment'>
32-
componentType: Link<'ComponentType'>
32+
componentType?: Link<'ComponentType'>
3333
template?: Link<'Template'>
3434
createdAt: string
3535
updatedAt: string

0 commit comments

Comments
 (0)