diff --git a/packages/rest-client-utils/src/serialize.ts b/packages/rest-client-utils/src/serialize.ts index 1604aad..1c0f478 100644 --- a/packages/rest-client-utils/src/serialize.ts +++ b/packages/rest-client-utils/src/serialize.ts @@ -49,7 +49,7 @@ export function serializeRequestBody( } as unknown as T; } - const { id, type, meta, ...otherProperties } = body as any; + const { id, meta, ...otherProperties } = body as any; const attributes: Record = {}; const relationships: Record = {}; @@ -116,7 +116,7 @@ export function serializeRequestBody( return { data: { ...(id || options.id ? { id: id || options.id } : {}), - type: type || options.type, + type: options.type, // If a body.type is passed in, it should go in data.attributes. Only options.type should be here at the root. ...(Object.keys(attributes).length > 0 ? { attributes } : {}), ...(Object.keys(relationships).length > 0 ? { relationships } : {}), ...(meta ? { meta } : {}),