Skip to content

Commit 9d4fae4

Browse files
tylerpinaclaude
andcommitted
fix: guard optional componentType access in experience update endpoint [DX-980]
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7682c8 commit 9d4fae4

1 file changed

Lines changed: 3 additions & 1 deletion

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: {

0 commit comments

Comments
 (0)